Re: PEAR::Quickform, advcheckbox

From: Date: Sat, 06 Nov 2004 18:42:15 +0000
Subject: Re: PEAR::Quickform, advcheckbox
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15371@lists.php.net to get a copy of this message
I check the code produced and I notice, the value is set to true (1) , but nowhere there is a checked option or a checked="checked"... How do that ? "Mos" <mos_fr@yahoo.fr> a écrit dans le message de news:20041106182008.64688.qmail@pb1.pair.com... > Hi everybody ! > > I created a Form with Quick Form and now I would be glad to set a link which > enables to check all the advcheckbox I set. > I try with javascript but it doesn't works... I have no idea how to do that > through PHP (I use PEAR::Pager inside my Form too). > > Here is the code I use to set up the form : > > $form->addElement('link', > 'select_all', > '', > '', > '<img src="./check.png" border=0 alt="Select > All" > title="Select All">', > array ('onclick' => "javascript:check_all(this.form);") > ); > > I add a select box : > $form->addElement('select', 'test', 'Status : ', > > array("0"=>"Choose","1"=>"Check","2"=>"Uncheck"), > array ('onchange' => > "javascript:this.form.submit();") ); > $form->setDefaults(array('online'=>$_SESSION["test"])); > > Then I process this in a call-back function : > foreach ($values['faq_selected'] as $test1=>$vals) > { > $sel =& $form->getElement("faq_selected[$test1]"); > $sel->setChecked(true); > } > > When I check the status of each checkbox I obtain true, but no tick is > dispalyed in the checkbox. > > What is the problem ? > > Best regards > > Mos

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