find all input elements in a form
$("form#formID :input").each(function(){
var input = $(this); // This is the jquery object of the input, do what you will
});
3.5
4
Find all input in a form
Thank you!
4
0
3
1
$("form").submit(function(){ return validateForm($(this)) });
function validateForm(form){
var retVal = true;
var re;
$.each(form.serializeArray(), function(i, field) {
var input = $('input[name='+field.name+']');
field.value = $.trim(field.value);
switch(field.name){
case "name" :
and another cases...
}
})
}
Thank you!
1
0
Are there any code examples left?
New code examples in category Javascript