Hi!
Im trying to validate my field, with aid from this post, https://sourceforge.net/forum/message.p ... id=3378302, but cant get i right.
Is this still correct in v2.2?
Im using the ASP-variant.
Johnny
Fri, 01/20/2006 - 01:57
#1
RE: Validate
(and thanks for all help, isn't validation a big topic? :/ )
Got the solution from a different forum, and hope it will help somebody else:
var strtext = window.frames['fckfield___Frame'].window.frames['eEditorArea'].document.getElementsByTagName('body').item(0).innerHTML;
if (strtext.length == 0 || strtext == "<P> </P>"){
alert("Fill in text.");
window.frames[fckfield___Frame'].window.frames['eEditorArea'].focus();
return (false);
}
The part "<P> </P>" is needed to capture if you delete all the text, and submit. Then the paragraph exists, even if not visible.
Johnny