RE: [PEAR] [Quickform] isSubmitted() returns TRUE when it should not

From: Date: Wed, 26 Oct 2005 21:27:57 +0000
Subject: RE: [PEAR] [Quickform] isSubmitted() returns TRUE when it should not
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21656@lists.php.net to get a copy of this message
I'm not a 100% clear about what you are trying to do, but if it sounds like you have Form 1 -> gets submitted -> display Form 2 ( which is a QuickForm ) If I were trying it I'd try: <?php require 'HTML/QuickForm.php'; funtction getRequest() { if ( isset( $_GET[thing] ) ) { $request = $_GET[thing]; } else if ( isset( $_POST[thing] ) ) { $request = $_POST[request]; } else { $request = NULL; } return $request; } if(!isset($request)) { echo " <html> <body> <form action=\"testsubmit.php\" name=\"form\" method=\"post\"> <input name=\"thing\" type=\"hidden\" value=\"something\"/> <input name=\"btnSubmit\" type=\"submit\" value=\"go\" /> </form> </body> </html>"; } else { $form = new HTML_QuickForm('formname'); $form->addElement('hidden', 'thing', getRequest() ); . add some more elements . add some more elements . add some more elements if( $form->validate() ) { process data } else { // if you are using smarty, replace $form->display() with your smaty assignments // e.g. $tpl->assign('content', $form->toHtml); or something. $form->display(); } } ?> Don't know if that's what you were trying to do or not ... >-----Original Message----- >From: Damien Cros [mailto:damienc@cc.in2p3.fr] >Sent: Wednesday, October 26, 2005 8:37 AM >To: PEAR general list >Subject: Re: [PEAR] [Quickform] isSubmitted() returns TRUE >when it should not > >Here's an example with SmartyStatic_example.php : >The file is called "testsubmit.php". > ><?php > > >if(!isset($_REQUEST['thing'])) >{ >echo " ><html> ><body> ><form action=\"testsubmit.php\" name=\"form\" >method=\"post\"> <input name=\"thing\" type=\"hidden\" >value=\"something\"/> <input name=\"btnSubmit\" >type=\"submit\" value=\"go\" /> </form> </body> ></html>"; > >} >else >{ > require_once('SmartyStatic_example.php'); >} > > >?> > >

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