HTML_Quickform_controller not getting $_GET variables?
Posted: Tue Nov 04, 2003 9:08 am
Hi. This is my first post on the forum, so please bear with me
I'm trying to build some complex forms with php, more precise with the
HTML_Quickform_controller package available from the PEAR network.
What I try to do is the following: when I click on a certain link, a new page
(a form) gets opened in a new window, and I pass some variables
together with the URL of the form. An example would be:
Now, in the file removeMe.php, I subclass HTML_QuickForm_Page to
create my form. (code below) However, the 'hidden' elements do not
work. They set the correct value the first time I call the page, but
every next call (with different parameters) leaves these hidden fields
on the same values as the first time. (Note that the $var1 variable
DOES change, strangemy enough!)
This is the relevant code:
I've checked the documentation and the source, but couldn't find out why
this is happening. Any help would be appreciated.
Thanks in advance,
Beek
I'm trying to build some complex forms with php, more precise with the
HTML_Quickform_controller package available from the PEAR network.
What I try to do is the following: when I click on a certain link, a new page
(a form) gets opened in a new window, and I pass some variables
together with the URL of the form. An example would be:
Code: Select all
window.open("removeMe.php?var1=1&var2=2")create my form. (code below) However, the 'hidden' elements do not
work. They set the correct value the first time I call the page, but
every next call (with different parameters) leaves these hidden fields
on the same values as the first time. (Note that the $var1 variable
DOES change, strangemy enough!)
This is the relevant code:
Code: Select all
class Remove extends HTML_QuickForm_Page {
function buildForm() {
$this->formBuilt = true;
$var1 = isset($_GETї'var1']) ? $_GETї'var1'] : "neverused";
$var2 = isset($_GETї'var2']) ? $_GETї'var2'] : "neverused";
$this->addElement('header', null, 'Variable is ' . $var1) //This works each time!!
//$this->addElement( .... add some elements ....);
$this->addElement('hidden', 'var1', $var1); //This only works the first time and then remains unchanged forever???
$this->addElement('hidden', 'var2', $var2);
$this->addElement('submit', $this->getButtonName('submit'), 'Remove');
$this->setDefaultAction('submit');
}
}this is happening. Any help would be appreciated.
Thanks in advance,
Beek