RE: [PEAR] QuickForm this.form.submit(), errors don't show up

From: Date: Mon, 19 Jun 2006 21:26:54 +0000
Subject: RE: [PEAR] QuickForm this.form.submit(), errors don't show up
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24439@lists.php.net to get a copy of this message
Thank you for your ideas Alexy, I wasn't able to get it to work. Oh well, it was more just eye candy anyway. Mark -----Original Message----- From: Alexey Borzov [mailto:borz_off@cs.msu.su] Sent: Monday, June 19, 2006 1:53 PM To: Mark Steudel Cc: pear-general@lists.php.net Subject: Re: [PEAR] QuickForm this.form.submit(), errors don't show up 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.htm l-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; >>> Example form >>> $form =& new HTML_QuickForm('testform'); >>> // Creates a checkboxes group using an array of separators >>> $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', >>> null, > 'A'); >>> $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', >>> null, > 'B'); >>> $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', >>> null, > 'C'); >>> $checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', >>> null, > 'D'); >>> $form->addGroup($checkbox, 'ichkABC', 'ABCD:', >>> array('&nbsp;', '<br > />')); >>> // 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( > "onclick"=> >>> "this.value='Submitting form please >>> wait...';this.disabled=true;this.form.submit();") ); -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.general (#24439) next »