开发者

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*$/))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜