how to validate space in htmleditor using javascript
function CheckDateEmpty(oSrc,args)
{
var editor = $find("<%=editorContent.ClientID%>");
var value = editor.get_content();开发者_开发知识库
if (value == "")
{
args.IsValid = false;
return;
}
else
{
editor.set_content(value);
args.IsValid = true;
return;
}
}
the above function check perfectly weather the html editor is empty or not....but if i'll enter space in my editor ...it consider it as a value ...i want it validate for the space...
Using a regex, check if all characters are whitespaces:
if (value.match(/^\s*$/))
精彩评论