1$("form#formID :input").each(function(){
2 var input = $(this); // This is the jquery object of the input, do what you will
3});
1$("form").submit(function(){ return validateForm($(this)) });
2function validateForm(form){
3var retVal = true;
4var re;
5$.each(form.serializeArray(), function(i, field) {
6 var input = $('input[name='+field.name+']');
7 field.value = $.trim(field.value);
8 switch(field.name){
9 case "name" :
10 and another cases...
11 }
12 })
13 }
1// Selects all input, textarea, select and button elements.
2const allInputs = $(":input");