Created
September 17, 2018 12:07
-
-
Save henideepak/bcf9f5be213c79d6677070759de07f06 to your computer and use it in GitHub Desktop.
Jquery Remove disabled attribut from submit form.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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