4
Hi Catzwolf
In the module I'm working on, the DHTML editor code appears like this:
if ($xoopsModuleConfig['bbcode'] == 1) {
$text_annonce = new XoopsFormDhtmlTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
} else {
$text_annonce = new XoopsFormTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc);
}
$adsform->addElement($text_annonce, true);
I found that in Xoops 2.0.18.2, the validation worked for the plain text editor, but not the DHTML editor. I thought the editor might need a more direct 'true' condition, so I changed it to this:
if ($xoopsModuleConfig['bbcode'] == 1) {
$adsform->addElement(new XoopsFormDhtmlTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc), true);
} else {
$adsform->addElement(new XoopsFormTextArea(_MD_CATADS_TEXTE_S.'*', "ads_desc", $ads_desc), true);
}
But still only the plain text area validated as required.
When I looked at the classes in 2.0.18.2 , The only difference I could see was that the validation function was included in 'formdhtmltextarea.php', but not in 'formtextarea.php'.
When I commented the function out in 'formdhtmltextarea.php', it worked.
Same with Xoops 2.3 and 2.4.
I guess it could be a conflict in the module somewhere, but the code seems valid. I am looking for another module where the DHTML editor field is required, just in case it is an anomoly!
A thread is for life. Not just for Christmas.