Link to home
Start Free TrialLog in
Avatar of sk5567
sk5567

asked on

String validation

Hi

I need to validate a string in javascript. If the string contains single quote or double quote I should alert the user.So how do I check for them using javascript.

Thanks
sk5567
ASKER CERTIFIED SOLUTION
Avatar of novicer
novicer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sk5567
sk5567

ASKER

Thanks for the help. In the alert message I have to show like this.

alert('charecter ' and " are not allowed.');

How to show them in the alert message?

-Sk5567

try this:
alert("character ' and \" are not allowed");