hi friends,
how to validate special characters in javascript with example....
like "./@#$%^&*(+)_" need to validate this special characters
thanks in advance.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
manjula dPosted Nov 14, 2013, 6:38 AM
function validateEmail(source, args)
{
var emialaddress = document.getElementById("#<%=txtemail.ClientId%>").val();
if(/^.@#$%^&*(+)_$/.test(emialaddress))
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}
Milstein MunakamiPosted Nov 10, 2013, 12:00 AM
Try this regex:
/^[@!#\$\^%&*()+=\-\[\]\\\';,\.\/\{\}\|\":<>\? ]+$/Also you can use
test.