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:
window.open("removeMe.php?var1=1&var2=2")
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, strangely enough!)
This is the relevant code:
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');
}
}
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