I was given the solution by someone. Here it is:
[code]
<h:commandButton value="submit" action="#{myBean.action}" onclick="return
confirm('Are you sure?');" />
[/code]
Julien.


2007/8/20, Julien Martin <[EMAIL PROTECTED]>:
>
> Hello,
> I would like for a user to confirm that he/she wants to undertake a submit
> action. I have a h:commandButton and I would like to use the JS confirm
> function and the onclick attribute in order to do that. The problem is when
> I want to submit the form (once the user has clicked yes on the confirm
> button) and I do not want to hard-code the path to the form. Another problem
> is that I have several h:commandButtons on the form.
> Can anyone please help?
> Thanks in advance,
> Julien Martin.
>

Reply via email to