I am having some trouble figuring out how to validate my textboxes using js. I have 10 textboxes, the user can fill out any number 1-10, but cant fill out 0. Here is the js th
you can use jquery. add common class name for all your textboxes i.e.
now in js function
function submit() { $('.student').each(function() { if($(this).val() == '' || $(this).val() == null) { // your error message return false; } } }
this function check all the elements with student class.