Re: QuickForm this.form.submit(), errors don't show up
| From: | Alexey Borzov | Date: | Mon, 19 Jun 2006 20:53:25 +0000 |
| Subject: | Re: QuickForm this.form.submit(), errors don't show up | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24437@lists.php.net to get a copy of this message | ||
Hi,
Mark Steudel wrote:
Actually I meant the server side message, not the javascript error message.Use the $trackSubmit parameter of QuickForm's constructor: http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.html-quickform.php Clarification: if you submit your form currently the $_POST array may be completely empty and form will be considered not submitted. Non-selected checkboxes do not appear in $_POST and since you are using form.submit() the name=value of your submit button isn't sent, either. The other possible approach is changing your javascript to this.value='Submitting form please wait...';this.disabled=true;return true;
'A');Example form $form =& new HTML_QuickForm('testform'); // Creates a checkboxes group using an array of separators $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null,'B');$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null,'C');$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null,'D');$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null,/>'));$form->addGroup($checkbox, 'ichkABC', 'ABCD:', array(' ', '<br"onclick"=>// At least one element is required $form->addGroupRule('ichkABC', 'Please check at least two boxes', 'required', null, 2); $form->addElement( 'submit', 'submitForm', 'Submit Form', array("this.value='Submitting form please wait...';this.disabled=true;this.form.submit();") );