Re: HTML QuickForm Stumper

From: Date: Thu, 23 Mar 2006 08:31:30 +0000
Subject: Re: HTML QuickForm Stumper
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23409@lists.php.net to get a copy of this message
James Reinke wrote: > For example: (what I ultimately need) > > <INPUT TYPE="RADIO" NAME="PaymentType" > VALUE="debitcard" > > ONCLICK="Show('debitcarddiv');Hide('creditcarddiv');Hide('checkingaccountdiv')" > <? if($_SESSION['account']->PayType=="debitcard") { > print "CHECKED"; } ?>>Pay by debit card<br /> > > (what I currently have) > > $form->addElement('radio', 'PaymentType', > array('value' => 'creditcard', 'onclick=' => > > 'Show(\'creditcarddiv\');Hide(\'debitcarddiv\');Hide(\'checkingaccountdiv\')')); Something like: if ($_SESSION['account']->PayType == 'debitcard') { $form->setValue(array('PaymentType' => 'debitcard'; } should do want you want. (Don't have time now to test whether this is really the right code, but setValue() should be the right way.) HTH, Mark

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