Ads

Monday, 1 July 2013

Sharepoint multiline textbox validation

Sharepoint multiline textbox validation


function PreSaveAction()    {

var checkItem = $('#<%=lblTrueFalse.ClientID%>').val();
         if (checkItem == "true")
         {
var value1=GetV3TextField('Approval Comments');
var Approvalvalue="";
if(navigator.appName == "Microsoft Internet Explorer")
{
Approvalvalue=$(value1).closest("span").find("iframe[Title='Rich Text Editor']").contents().find("body").text();

}
else
{
Approvalvalue=$(value1).val();
}
//var Approvalvalue=$(value1).val();

if(Approvalvalue =='' || Approvalvalue ==null)
{
alert('Please add some comments');
return false;
}
else
{

return true;
}

}
}

No comments:

Post a Comment

Ads