Re: HTML_QuickForm_Controller - setDefaultAction behaviour
| From: | Mario Callisto | Date: | Fri, 10 Oct 2008 09:47:09 +0000 |
| Subject: | Re: HTML_QuickForm_Controller - setDefaultAction behaviour | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29326@lists.php.net to get a copy of this message | ||
Hi Alexey,
thank you for your reply.
The reported behaviour happens for sure with the latest Firefox on
Ubuntu 8.04 linux.
Solved it so far by putting the "default" button first, as you
suggested.
Best,
Mario
Il giorno lun, 29/09/2008 alle 13.00 +0400, Alexey Borzov ha scritto:
> Hi,
>
> Mario Callisto wrote:
> > Started with the wizard.php sample at
> >
> > http://pear.php.net/package/HTML_QuickForm_Controller/docs/latest/__filesource/fsource_HTML_QuickForm_Controller__HTML_QuickForm_Controller-1.0.9exampleswizard.php.html
> > and replicated as it is on my test environment.
> >
> > When on page 2 of 3 of the multipage form, after filling with text the
> > text fields and pressing Enter on the keyboard (instead of clicking the
> > Submit button) I am redirected to page 1 and not to page 3 as expected.
> >
> > This should be handled by line 79:
> > $this->setDefaultAction('next');
> > which appears to be ok. The strange abovementioned behaviour should
> > instead be produced by:
> > $this->setDefaultAction('back');
> > Both 'next' and 'back' seem valid names of buttons created a few lines
> > earlier.
> > Substituting it with
> > $this->setDefaultAction('doesntexist');
> > produces the same 'back to page 1' result.
>
> I think this behaviour is unfortunately browser-dependent. Some browsers don't
> consider any button clicked when one presses "Enter" (and that's when
> setDefaultAction() works), some consider the first button in the form clicked
> (and that's the behaviour you are seeing). The only solution is to put the
> "default" button first, maybe it will also work with tabindex attribute.