Enable/disable submit depending on filled out form
in Getting Started
•
3 years ago
Hi there,
What I want to do is: disable the submit button while not all form fields are filled out and eneble it when the form fields are filled out. Disabling works, the enabling doesn't, at least not 'automaticly'. All of the code is in the $(document).ready(function(){}
I have this code:
Where '#zeteltoto_form input[type=text]' is the form
{
$('#zeteltoto_form input[type=text]').each(function(n,element)
{
if (!$(element).val()=='')
{
$("#verzend").css('visibility', "visible");
$("#verzend").removeAttr('disabled');
return false;
}
else
{
$("#verzend").css('visibility', "hidden");
$("#verzend").attr("disabled","disabled");
return true;
}
});
}
and $("#verzend") is the submit-button
1



