Find All the controls in a form using jQuery or javascript -
i starter in jquery . how find controls in form using jquery?
i know code this
function submitvalidator(){ $("form :input").each(function(){ });
i want access id's , need apply regular expressions
some of text boxes numeric remaining alphanumeric. there method sort them apply regular expressions?
you can add new property data-charset in html
<input type="text" id='amt' data-charset='numeric'>
add controlles want add after "form :"
function submitvalidator(){ $("form :text, textarea").each(function(){ var numericonly = "^[0-9]*$"; var svid = $(this).attr('id'); if($(this).attr('data-charset') == 'numericonly') { if(!$(this).val().match(numericonly)) { alert("numeric"); eval("$('#" + svid +"').focus();") return false; } } }); }
Comments
Post a Comment