Hi,
I am trying to check whether the textbox contains single quote,double quote and < and > symbols.
I got the regex to check all the requirements.
its as shown below.
str=(document.getElementById('txtEnter')).value;
str.match(/([\<\])(1,))* ([\>])/)==null (for checking < and > symbol)
str.match(["'"])==null (for checking single quote)
and
str.match(['"'])==null) (for checking double quotes.)
Now i give all these conditions as
if(str.match(/([\<\])(1,))* ([\>])/)==null && str.match(["'"])==null && (str.match(['"'])==null))
alert("error");
else
alert("no error");
It works fine.
In the above code i used str.match() three times. I need to use str.match() only one time and need to check whether the textbox contains < or > or single quote or double qoute.
Please help me..
Thanks in Advance.
Mathew.