Ignore input fields on submit form using jQuery

I would like to include only certain form fields when submitting a form using jQuery. For example, I would like to ignore all fields that have an attribute disabled... maybe something like this:

$('#my_button').click(function() {
    if($('input').hasAttr('disabled') {
        //ignore this form field when submitting
    }
    $('form').submit();
});

Any ideas?

+5
source share
1 answer

What is not needed, inputs disabledare already excluded . Various jQuery methods, including submit () and serialize (), conform to the HTML 4 specification for disabled controls in web forms, which looks like this:

"" . . FORM .

:

  • disabled .

http://www.w3.org/TR/html401/interact/forms.html#successful-controls

+14

All Articles