* Configure the email address element * Filters: Trim * Validators: Required, Email */ $email = new Quform_Element('email', 'Email address'); $email->addFilter('trim'); $email->addValidators(array('required', 'email')); $form->addElement($email); /** * Configure the message element * Filters: Trim * Validators: Required */ $message = new Quform_Element('message', 'Message'); $message->addFilter('trim'); $message->addValidator('required'); $form->addElement($message); /** * Configure the CAPTCHA element (REMOVE ""//"" ON LINES 215/216 WHEN YOU START GETTING SPAM)!!!! * Filters: Trim * Validators: Required, Identical */ $captcha = new Quform_Element('type_the_word', 'Type the word'); $captcha->addFilter('trim'); //$captcha->addValidator('required'); //$captcha->addValidator('identical', array('token' => 'catch')); $captcha->setIsHidden(true); $form->addElement($captcha); /** END FORM ELEMENT CONFIGURATION **/ function process(Quform $form, array &$config) {
* Configure the message element * Filters: Trim * Validators: Required */ $message = new Quform_Element('message', 'Message'); $message->addFilter('trim'); $message->addValidator('required'); $form->addElement($message); /** * Configure the CAPTCHA element * Filters: Trim * Validators: Required, Identical */ $captcha = new Quform_Element('type_the_word', 'Type the word'); $captcha->addFilter('trim'); $captcha->addValidator('required'); $captcha->addValidator('identical', array('token' => 'catch')); $captcha->setIsHidden(true); $form->addElement($captcha); /** END FORM ELEMENT CONFIGURATION **/ function process(Quform $form, array &$config) { // Process the form if ($form->isValid($_POST)) { // Custom code section #1 - see documentation for examples // End custom code section #1 try { $attachments = array(); $elements = $form->getElements(); // Process uploaded files foreach ($elements as $element) {
/** * Configure the alphabet filtered field * Filters: Alpha * Validators: Required */ $alphaElement = new Quform_Element('alpha_filter'); $alphaElement->addValidator('required'); $alphaElement->addFilter('alpha'); $form->addElement($alphaElement); /** * Configure the regex filtered field * Filters: Regex * Validators: Required */ $regexElement = new Quform_Element('regex_filter'); $regexElement->addValidator('required'); $regexElement->addFilter('regex', array('pattern' => '/[\\d+]/')); $form->addElement($regexElement); /** * Configure the CAPTCHA field * Filters: Trim * Validators: Required, Identical */ $captcha = new Quform_Element('type_the_word'); $captcha->addFilter('trim'); $captcha->addValidators(array('required', array('identical', array('token' => 'catch')))); $captcha->setIsHidden(true); $form->addElement($captcha); /** END FORM ELEMENT CONFIGURATION **/ function process(Quform $form, array &$config) {
* password - SMTP password * encryption - SMTP encryption (e.g. ssl or tls) */ $config['smtp'] = array('host' => '', 'port' => 25, 'username' => '', 'password' => '', 'encryption' => ''); // Add the visitor IP to the email $config['extra']['IP address'] = Quform::getIPAddress(); /** END FORM SETTINGS **/ /** FORM ELEMENT CONFIGURATION **/ /** * Configure the first name element * Filters: Trim * Validators: Required */ $firstName = new Quform_Element('full_name', 'Name'); $firstName->addFilter('trim'); $firstName->addValidator('required'); $form->addElement($firstName); /** * Configure the email address element * Filters: Trim * Validators: Required, Email */ $emailAddress = new Quform_Element('email', 'Email address'); $emailAddress->addFilter('trim'); $emailAddress->addValidators(array('required', 'email')); $form->addElement($emailAddress); /** END FORM ELEMENT CONFIGURATION **/ function process(Quform $form, array &$config) { // Process the form if ($form->isValid($_POST)) {
$form->addElement($textInput3); $textInput4 = new Quform_Element('text_input4', 'Text input 4'); $textInput4->addFilter('trim'); $textInput4->addValidator('required'); $form->addElement($textInput4); $textInput5 = new Quform_Element('text_input5', 'Text input 5'); $textInput5->addFilter('trim'); $textInput5->addValidator('required'); $form->addElement($textInput5); $textInput6 = new Quform_Element('text_input6', 'Text input 6'); $textInput6->addFilter('trim'); $textInput6->addValidator('required'); $form->addElement($textInput6); $textInput7 = new Quform_Element('text_input7', 'Text input 7'); $textInput7->addFilter('trim'); $textInput7->addValidator('required'); $form->addElement($textInput6); $singleSelect = new Quform_Element('single_select', 'Single select'); $singleSelect->addValidator('required'); $form->addElement($singleSelect); $subject = new Quform_Element('subject', 'Subject'); $subject->addFilter('trim'); $form->addElement($subject); $multiSelect = new Quform_Element('multi_select[]', 'Multi select'); $multiSelect->addValidator('required'); $form->addElement($multiSelect); $singleCheckbox = new Quform_Element('single_checkbox', 'Single checkbox'); $singleCheckbox->addValidator('required'); $form->addElement($singleCheckbox); $radioButton = new Quform_Element('multi_checkbox[]', 'Multi checkbox'); $radioButton->addValidator('required');