I have a form with 3 text boxes for name, phone, email address. What I want is only alphabets are allowed in name only numbers are allowed in phone and email is allowed in email box? I have a submit button, when I click that button it should check above validations. Can anyone help me with it?
You should RegExp. Put these tests in conditionals to verify... name.match(/^[a-zA-Z]+$/) phone.match(/^[0-9]+$/) email.match(/^[a-zA-Z\.\-]+\@[a-z\.\-]+\.(?:com|net|org|biz|info|tv|mobi|name)$/) Code (markup): Note that the email match isn't perfect.