js clear entry textbox when submit button is clicked code example
Example 1: how to clear radio button input when someone types in an input field
<script>
$('#textInput').click(function () {
$('input[name="radio"]').prop("checked", false);
});
</script>
Example 2: disabling submit button until all fields have values
$(function () {
$('#submits').attr('disabled', true);
$('#initial_5').change(function () {
if ($('#initial_1').val() != '' && $('#initial_2').val() != '' && $('#initial_3').val() != '' && $('#initial_4').val() != '' && $('#initial_5').val() != '') {
$('#submits').attr('disabled', false);
} else {
$('#submits').attr('disabled', true);
}
});
});
Example 3: reset submit btn style
button, input[type="submit"], input[type="reset"] {
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
}