ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pear-general
pear-general
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved