For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > September 2007 > HTML_QuickForm problems using $_REQUEST val for hidden element









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML_QuickForm problems using $_REQUEST val for hidden element
Jeremiah Mattison

2007-09-24, 10:06 pm

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.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com