HTML_Quickform hidden elements

From: Date: Fri, 27 Sep 2002 15:42:46 +0000
Subject: HTML_Quickform hidden elements
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-9613@lists.php.net to get a copy of this message
Hi, i am a little bit confused about the class HTML_QuickForm_hidden in the file hidden.php . <code> function HTML_QuickForm_hidden($elementName=null, $value='', $attributes=null) { HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes); $this->setType('hidden'); // don't override GET/POST settings $tmp_val = $this->getValue(); if (is_null($tmp_val)) { $this->setValue($value); } } //end constructor </code> Something like the code below will not work, because $counter is always 1. Why is $this->setValue($value) only done, if $tmp_val is null? require_once("HTML/QuickForm.php"); $counter = $_POST["tmp_hidden"]; $counter++; $form =& new HTML_QuickForm('tmp_form','POST'); $form->addElement('hidden','tmp_hidden', $counter); $form->addElement('submit','tmp_submit','Submit Form'); $form->display(); Thanks a lot, Jörn

« previous php.pear.dev (#9613) next »