Answer the question
In order to leave comments, you need to log in
jquery form validation with hide button submit?
Is there a jquery plugin that validates the form and hides the submit button, if the validation fails, and if everything is fine, then submit opens.
Answer the question
In order to leave comments, you need to log in
In an HTML document:
<form action="">
<input type="text" id="text">
<input type="submit" id="submit" style="display:none;">
</form>
function validate(){
if( $('#text').val() == 123 ){
$('#submit').show();
}else{
$('#submit').hide();
}
}
$('#text').keyup(function(){
validate();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question