ok sorry for that.
i found this solution..it works fine
function isEmpty( str){
strRE = new RegExp( );
strRE.compile( '^[\s ]*$', 'gi' );
return strRE.test( str.value );
}
but i wanted to know what exactly he is doing ..can any one explain me....
Thanks,
Pradeep
Hi
the string '^[\s ]*$' is a regular expression.
[\s] matches the blank character.
[\s]* matches many blank characters.
^[\s]* matches at the start of the blank string,
[\s]*$ matches at the end of the blank string.
So , ^[\s ]*$' matches at the start of the blank string till the end of the blank string. It matches the blank string.
if "str.value" is a blank string , it will match the regular pattern '^[\s ]*$' . Then "strRE.test( str.value )" will be true.
You can have a look at Regular Expression syntax reference.
http://www.regular-expressions.info/reference.html
hope it helps.