[PEAR] QuickForm and hidden field type
by xav other posts by this author
Oct 11 2002 11:58AM messages near this date
[PEAR] HTML::QuickForm question
|
Re: [PEAR] QuickForm and hidden field type
Hello all,
I got a problem with hidden fields in Quickform.
I want to create an hidden field value on a condition and Quickform
doesn't seems to agree with me ;)
Just have a look at the code below, when I call it with a get param
called "action" the hidden field should be created and set action to
"domodif" but it only returns "modif" .
If I rename the hidden field to whatever else, it works fine...
Am I doing a big mistake ? or is it a bug ?
Thanks
--
xav
--------------------------------------------------------------
<?
require_once('HTML/QuickForm.php');
if ($_GET['action']) $action = $_GET['action'] ;
elseif ($_POST['action']) $action = $_POST['action'];
else $action = "create" ;
$form = new HTML_QuickForm('test', 'POST', $self);
if ($action == 'modif') {
$form-> addElement('hidden', 'action', 'domodif');
}
$form-> addElement('text', 'something', 'blabla:');
$form-> addElement('submit', NULL, 'go');
$form-> toHtml();
$form-> display();
?>
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
xav
Martin Tsachev
|