Hello,
I have a couple of questions on xoopsform classes.
I'm in the process of editing the Extended Profiles registration form (with some hacks). I am adding the form elements manually instead through the Administration panel (this is required in my hack).
However I can't figure out how to make XoopsFormElementTray and XoopsFormSelect reuired items. I.e. included in the javascript validation.
For instance in XoopsFormText I would add the (,true); to make it required:
$reg_form->addElement(new XoopsFormText("First Name", 'firstname', 50, 80, $firstname), true);
However how would I do it in a XoopsFormSelect?
I have:
$state_select = new XoopsFormSelect("State", "entry_state", $set_state);
$state_select->addOption('', 'Please Select');
while (list($zone_id, $zone_name) = $xoopsDB->fetchRow($zones_query) ) {
$state_select->addOption($zone_id, $zone_name);
}
$reg_form->addElement($state_select);
I would also like to know how to make the XoopsFormElementTray required. For instance I would like to conver the password field:
$reg_form->addElement(new XoopsFormPassword(_PROFILE_MA_PASSWORD, "pass", 10, 32, ""), true);
so that I could display to the user how many characters are needed in the password:
$pass_tray = new XoopsFormElementTray(_PROFILE_MA_PASSWORD);
$pass_tray->addElement(new XoopsFormPassword('', "pass", 10, 32, ""), true);
$pass_tray->addElement(new XoopsFormLabel('', $xoopsModuleConfig['minpass'].' characters minimum'));
$reg_form->addElement($pass_tray);
If anyone has an idea I would appreciate it. I am also looking at being able to add server-side validation for some of my fields.
Thank you!