function validate()
{
var textbox= $("#inputtextbox").val();
var match = /^([a-zA-Z0-9]{1,})$/;
if(!match.test(textbox)) {
$("#dataError").text('Min 1 alpha numeric characters and space allowed.').fadeOut(5000);
return false;
}
var textbox= $("#inputtextbox").val();
var match = /^([a-zA-Z0-9]{1,})$/;
if(!match.test(textbox)) {
$("#dataErr").text('Min 1 alpha numeric characters and space allowed.').fadeOut(5000);
return false;
}
}
I’ve a form and two text boxes.I’m validating two text boxes.Say,when i do not fill both text boxes and click submit button,it is only print the error message for first textbox.
When i fill every thing properly in first text box and i do not fill any thing in second text,now if i submit,it is showing error message for second text box,why is it not showing the message,when both not filled.
Thanks in advance!
try this
UPDATE