Hi,
my question: How can I check with Javascript if an fckeditor-instance is filled after sending a form?
The Form:
<tr>
<td class='head' colspan='2'>
</td>
</tr>
<tr>
<td class='space' colspan='2'>
<div></div>
</td>
</tr>
<tr><td class='rahmen'><div class='text_bold'>berschrift: </td><td class='rahmen'><textarea rows='3' cols='50' name='ueberschrift'></textarea></div></td></tr>
<tr><td class='rahmen'><div class='text_bold'>Punkt1: </td><td class='rahmen'>
<input type='text' name='punt1'>
</div></td></tr>
I've tried these versions:
if (document.formular.nachricht.value.length!=0) {
alert("Bitte fllen Sie das Feld Punkt1 aus!");
return (false);
} //if
if (Window.frames[0].objContent.DOM.body.innerText.length==0) {
alert("Bitte fllen Sie das Feld Punkt1 aus!");
return (false);
} //if
But this didn't work.
Your help is welcome.
Best regards,
Thorsten
my question: How can I check with Javascript if an fckeditor-instance is filled after sending a form?
The Form:
<form action = '<?php $PHP_SELF ?>' method = 'post' name='formular'>
<tr>
<td class='head' colspan='2'>
<p class='head'><?=$head?></p>
</td>
</tr>
<tr>
<td class='space' colspan='2'>
<div></div>
</td>
</tr>
<tr><td class='rahmen'><div class='text_bold'>berschrift: </td><td class='rahmen'><textarea rows='3' cols='50' name='ueberschrift'></textarea></div></td></tr>
<tr><td class='rahmen'><div class='text_bold'>Punkt1: </td><td class='rahmen'>
<input type='text' name='punt1'>
<?php
$oFCKeditor = new FCKeditor ;
$oFCKeditor->ToolbarSet = 'Accessibility' ;
$oFCKeditor->CanUpload = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CanBrowse = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CreateFCKeditor( 'nachricht', '100%', 150 ) ;
?>
</div></td></tr>
I've tried these versions:
if (document.formular.nachricht.value.length!=0) {
alert("Bitte fllen Sie das Feld Punkt1 aus!");
return (false);
} //if
if (Window.frames[0].objContent.DOM.body.innerText.length==0) {
alert("Bitte fllen Sie das Feld Punkt1 aus!");
return (false);
} //if
But this didn't work.
Your help is welcome.
Best regards,
Thorsten
RE: Form-check with Javascript
the form value to check is 'myEditor'
look at the source of the page where the editor is generated to see the hidden field.
RE: Form-check with Javascript
1. @nathfy: where can i change the name of the instance?
2. @thkolz: have the answer helped you?
thank you very much, guys!