Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

validating FCKeditor

how can FCKeditor be validated for required field using javascript.

like image 420
koin Avatar asked Oct 14 '22 23:10

koin


1 Answers

Try this,

var EditorInstance = FCKeditorAPI.GetInstance('message') ; 
if(EditorInstance.EditorDocument.body.innerText.length<=0)
{
alert("This firld is mandatory");
EditorInstance.EditorDocument.body.focus();
return false;
}

Source:

http://dreamtechworld.wordpress.com/2008/12/06/validating-firld-in-fckeditor-using-javascript/

like image 127
ACP Avatar answered Oct 16 '22 15:10

ACP