I would like to include only certain form fields when submitting a form with jQuery. For instance, I would like to ignore all fields that have the disabled attribute… maybe something like this:
$('#my_button').click(function() {
if($('input').hasAttr('disabled') {
//ignore this form field when submitting
}
$('form').submit();
});
Any ideas?
That’s not necessary,
disabledinputs are excluded already. The various jQuery methods, including submit() and serialize() honour the HTML 4 specification for disabled controls in web forms, which goes as follows:http://www.w3.org/TR/html401/interact/forms.html#successful-controls