You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Pfau, Oliver" <ol...@siemens.com> on 2007/03/01 14:39:45 UTC
Navigation with onclick and commandButton
Hi,
I have a onclick JavaScript function on a commanButton. When user clicks
the button, the button will be disabled to avoid double submit. But with
the definition of a onclick function the navigation fails. My button
leads to another JSP. Without onclick it works fine. With onclick the
same page refreshs.
Any idea ?
Regards,
Oliver
Re: Navigation with onclick and commandButton
Posted by Simon Kitching <si...@rhe.co.nz>.
Pfau, Oliver wrote:
> Hi,
>
> I have a onclick JavaScript function on a commanButton. When user clicks
> the button, the button will be disabled to avoid double submit. But with
> the definition of a onclick function the navigation fails. My button
> leads to another JSP. Without onclick it works fine. With onclick the
> same page refreshs.
> Any idea ?
The standard behaviour of HTML is for the submit to be cancelled if the
onclick function returns false. Are you sure the page is submitting at all?
try:
onclick="doMyStuff(); return true;"