Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.