Thursday, 5 September 2013

for form validation is there any other methods than Regex in javascript?

for form validation is there any other methods than Regex in javascript?

can anyone tell methods of form validation other than regex in javascript
also can anyone suggest any alternate methods without Regex for this
following code?
function AllowAlphabet(){
if (!frm.alphabet.value.match(/^[a-zA-Z]+$/) &&
frm.alphabet.value !="")
{
frm.alphabet.value="";
alert("Please Enter only alphabets");
}
if(frm.alphabet.value.length > 5)
alert("max length exceeded");

No comments:

Post a Comment