HTML_QuickForm problems using $_REQUEST val for hidden element
| From: | Jeremiah Mattison | Date: | Mon, 24 Sep 2007 23:56:31 +0000 |
| Subject: | HTML_QuickForm problems using $_REQUEST val for hidden element | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-27970@lists.php.net to get a copy of this message | ||
So I'm trying to pass the contents of an element back to the form as a hidden element to do some checking to see if the content had changed before doing validation. The problem is it just keeps passing the original value of that post var (if any) even though I can dump the var contents and see that it has changed right before the QF code. I can pass a manually coded hidden element just fine. Here is a basic example:
---
print_r($_REQUEST);
$form = new HTML_QuickForm('frmTest');
$form->addElement('text', 'test', 'Test:');
$form->addElement('hidden', 'lasttest', $_REQUEST['test']);
$form->addElement('hidden', 'manual', 'manual');
$form->addElement('submit', 'btnSubmit', 'Submit');
$form->display();
---
If I enter "one" the first time I get this:
Array
(
[lasttest] =>
[manual] => manual
[test] => one
[btnSubmit] => Submit
)
If I enter "two" this time I get this:
Array
(
[lasttest] =>
[manual] => manual
[test] => two
[btnSubmit] => Submit
)
... Am I just completely missing something here? Thanks.