You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$select = $this->modules->get('InputfieldSelect');
$selectType->name = 'select-name';
$selectType->addOption('B', $this->_('Option B'));
$selectType->addOption('A', $this->_('Option A'));
$selectType->value = 'B'; // if you want to set a predefined value
// create and append fields$form->append($field);
// or create fieldset and add fields there$fieldset = $this->modules->get('InputfieldFieldset');
$fieldset->label = 'Some Label';
$fieldset->add($field);
$form->append($fieldset);
$form->render();
Process Form
$form->processInput($this->input->post);
// add additional error checks// email unique$email = $form->get('email');
$unique = $this->users->get("email=$email");
if ($unique->count() > 0) $email->error(__('This email address is already registered.'));
if ($form->getErrors()) {
// the form contains errorsreturn$form->render();
} else {
// do with the form what you like, create and save it as page// or send emails. to get the values you can use// $email = $form->get("email")->value;// to sanitize input// $email = $sanitizer->email($form->get("email")->value);return"<p>You submission was completed! Thanks for your time.";
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters