Jump to content

PEAR QuickForm


pogij

Recommended Posts

Hi.

I'm writing web application using PEAR Quickform and I came across this problem:

 

I have a quickform class which looks like something this:

 

class enaana extends HTML_QuckForm {

 

function enaena($x, $y) {

parent::HTML_QuickForm('', 'POST', '');

$this->addElement('hidden', 'iks', $x);

$this->addElement('hidden', 'ipsilon', $y);

$this->addElement('submit', 'submit', 'submit');

$this->display();

}

}

 

 

And I use this class several times in one page like this:

 

...

foreach ($trol as $t2) {

...

new enaena($t2->getIks(), $t2->getIpsilon());

...

}

...

 

 

 

When I load the page the HTML form looks normal like this:

 

...

<form ...>

<div>

<input type='hidden' name='iks' value='1'>

<input type='hidden' name='ipsilon' value='a'>

<input type='submit' name='submit' value='submit'>

</div>

</form>

...

<form ...>

<div>

<input type='hidden' name='iks' value='2'>

<input type='hidden' name='ipsilon' value='b'>

<input type='submit' name='submit' value='submit'>

</div>

</form>

...

<form ...>

<div>

<input type='hidden' name='iks' value='3'>

<input type='hidden' name='ipsilon' value='c'>

<input type='submit' name='submit' value='submit'>

</div>

</form>

...

 

 

But when I click one of the submit buttons for example second submit, the reloaded HTML page will look like this:

 

...

<form ...>

<div>

<input type='hidden' name='iks' value='2'>

<input type='hidden' name='ipsilon' value='b'>

<input type='submit' name='submit' value='submit'>

</div>

</form>

...

<form ...>

<div>

<input type='hidden' name='iks' value='2'>

<input type='hidden' name='ipsilon' value='b'>

<input type='submit' name='submit' value='submit'>

</div>

</form>

...

<form ...>

<div>

<input type='hidden' name='iks' value='2'>

<input type='hidden' name='ipsilon' value='b'>

<input type='submit' name='submit' value='submit'>

</div>

</form>

...

 

 

So all components values of all forms are replaced with the values from a form which was submitted.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/252737-pear-quickform/
Share on other sites

OK. But if instead of quickform i just write HTML code this does not happen:

 

<form ...>

<input type='hidden' name='iks' ...>

<input type='hidden' name='ipsilon' ...>

</form>

...

<form ...>

<input type='hidden' name='iks' ...>

<input type='hidden' name='ipsilon' ...>

</form>

...

<form ...>

<input type='hidden' name='iks' ...>

<input type='hidden' name='ipsilon' ...>

</form>

Link to comment
https://forums.phpfreaks.com/topic/252737-pear-quickform/#findComment-1295695
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.