This code works:
$checkbox2 = new XoopsFormSelect('Select Caption2', 'select2', null, 3); $checkbox2->addOption(0, 'Yes'); $checkbox2->addOption(1, 'No'); $checkbox2->addOption(2, 'Maybe'); $form->addElement($checkbox2, true);
I assume that you are using select box with 1 field height, in that case the current field is marked as selected(by the browser I guess) and will always pass validation.
I assume you are using something like ''=> 'Select a field';
Notice that your solution will also fail validation if the first option is not empty. Example:('field_0'=>'Yes', 'field_1'=>'No')
I would prefer not changing core. You could change the size of the select box, just make it > 1;
Regarding the DhtmlTextArea, it should be fixed in 2.5 now.
I've created a testform.php in the root of my Xoops Instalation. Here is the code I used:
include 'mainfile.php';
include 'header.php';
xoops_load('xoopsformloader');
$form = new XoopsThemeForm('Form', 'form', 'testform.php');
$checkbox = new XoopsFormCheckBox('Check Caption', 'check');
$checkbox->addOption(0, 'Yes');
$checkbox->addOption(1, 'No');
$checkbox->addOption(2, 'Maybe');
$form->addElement($checkbox, true);
$checkbox2 = new XoopsFormSelect('Select Caption2', 'select2', null, 3);
$checkbox2->addOption(0, 'Yes');
$checkbox2->addOption(1, 'No');
$checkbox2->addOption(2, 'Maybe');
$form->addElement($checkbox2, true);
$form->addElement(new XoopsFormDhtmlTextArea('Text', "text"), true);
$editor = new XoopsFormEditor('Text2', 'text2', array('editor' => 'DhtmlTextarea'));
$form->addElement($editor, true);
$editor2 = new XoopsFormEditor('Text3', 'DhtmlTextarea', array('name' => 'text3'));
$form->addElement($editor2, true);
$button = new XoopsFormButton('Submit', 'submit', 'Submit button', 'submit');
$form->addElement($button);
$form->display();
include 'footer.php';
?>