do parameter disappears after $form->setAction
- tomcat4x
- Member | 22
I am not sure if thats a bug, but i am wondering that the hidden do parameter in a html form disappears when using the function
$form->setAction();
For example:
protected function createComponentSimpleForm()
{
$form = new Form;
$form->addText('name', 'Name:');
$form->addSubmit('search', 'Search');
$form->onSuccess[] = array($this,'simpleFormSucceeded');
return $form;
}
here everything works well and after rendering the form there is an hidden parameter in the html
<input type="hidden" name="do" value="simpleForm-submit">
But after adding
$form->setAction($this->link('SearchResult:Simple'));
the hidden parameter in html form disappears.
- old.gandalf
- Member | 17
Hello,
this is quite strange, I'm using setAction() in a project driven by
Nette 2.2.3 and the ‘do’ hidden input doesn't
disappear.
Have you tried calling the setAction() method before
setting the onSuccess callback? I suppose it won't make any
difference, but you can at least give it a try ;)
- tomcat4x
- Member | 22
David Grudl wrote:
Update to Nette > 2.2.3 https://github.com/…on/issues/33
I am using nette 2.3.5
Shall i downgrade?
- tomcat4x
- Member | 22
old.gandalf wrote:
Hello,
this is quite strange, I'm using setAction() in a project driven by Nette 2.2.3 and the ‘do’ hidden input doesn't disappear.
Have you tried calling the setAction() method before setting the onSuccess callback? I suppose it won't make any difference, but you can at least give it a try ;)
It makes no difference.
- tomcat4x
- Member | 22
Casper wrote:
There are some (cs) threads (en) about it.
You will probably need to setup the
do
parameter manually.
I can do so. But what is the sense of the setAction method if the form afterwards does not work as expected and why is there no hint in the documentation.
Last edited by tomcat4x (2015-09-28 09:18)