Enable/disable submit depending on filled out form

Enable/disable submit depending on filled out form

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:

   
  1.  checkAll();

   
  1. function checkAll()
    {
    $('#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;
    }
    });
    }


















Where '#zeteltoto_form input[type=text]' is the form

and $("#verzend") is the submit-button