function nameoffun()
{
var name = document.getElementById('inputboxid').value;
var pattern = /^[a-zA-Z0-9]+$/; //it allow only alphanumeric characters, not allow space b/w them..
if(pattern.test(name))
return true;
else
return false;
}
{
var name = document.getElementById('inputboxid').value;
var pattern = /^[a-zA-Z0-9]+$/; //it allow only alphanumeric characters, not allow space b/w them..
if(pattern.test(name))
return true;
else
return false;
}
No comments:
Post a Comment