Hi Trabis,
Test conditions:
System features:
Versión de Xoops XOOPS 2.5.0
Versión de PHP 5.2.11
Versión de mySQL 5.1.38-log
API del Servidor cgi-fcgi
OS Linux
safe_mode Off
register_globals Off
magic_quotes_gpc Off
allow_url_fopen Off
fsockopen On
post_max_size 60M
max_input_time 120
output_buffering 4096
max_execution_time 120
memory_limit 128M
file_uploads On
upload_max_filesize 60M
Code used:
include 'mainfile.php';
include 'header.php';
xoops_load('xoopsformloader');
$form = new XoopsThemeForm('Form', 'form', 'testform.php');
$checkbox = new XoopsFormCheckBox('Check Caption multi option', 'checkmulti');
$checkbox->addOption(0, 'Yes');
$checkbox->addOption(1, 'No');
$checkbox->addOption(2, 'Maybe');
$form->addElement($checkbox, true);
$checkbox2 = new XoopsFormCheckBox('Check Caption only 1 option', 'checkonlyone');
$checkbox2->addOption(0, 'Yes');
$form->addElement($checkbox2, true);
$select = new XoopsFormSelect('Select Caption multi option', 'select', null, 3);
$select->addOption(0, 'Yes');
$select->addOption(1, 'No');
$select->addOption(2, 'Maybe');
$form->addElement($select, true);
$select2 = new XoopsFormSelect('Select Caption only 1 option', 'select2', null, 3);
$select2->addOption(0, 'Yes');
$form->addElement($select2, 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';
?>
Test results:
With the original code operation of XOOPS 2.5.0 the operation code in different browsers (IE, Firefox and Chrome) is as follows:
Pressing Submit without filling any field displays the validation error of the first checkbox (multiple) and position the cursor in the field with error (works fine).
Selecting an option in the first checkbox and pressing submit without filling anything else, shows validation error in the second checkbox, but send or reset the form.
With the modified code in XOOPS 2.5.0 is the correct operation in both checkbox and with different browsers (IE, Firefox and Chrome).
Thanks
Satrebil