Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save henideepak/bcf9f5be213c79d6677070759de07f06 to your computer and use it in GitHub Desktop.
Save henideepak/bcf9f5be213c79d6677070759de07f06 to your computer and use it in GitHub Desktop.
Jquery Remove disabled attribut from submit form.
//Jquery Remove disabled attribut from submit form. validate form without jquery validation.
<form>
<input type="text" class="form_field">
<input type="text" class="form_field">
<input type="email" class="form_field">
<input type="submit" class="sendButton">
</form>
<script>
$('.sendButton').prop('disabled', true);
$('.form_field').on('change keyup', function () {
$('.form_field').each(function () {
if ($(this).val() == '') {
$('.sendButton').prop('disabled', true);
return false;
}else {
$('.sendButton').prop('disabled', false);
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment