Hi, leave out the "javascript:" and it will work fine:
<x:commandLink onclick="showPopup('popupConfirmReview');return false;" ...
Jecker Frédéric (LFR) wrote:
Thanks for this hint but it doesn't work
I've tried
<x:commandLink onclick="javascript:showPopup('popupConfirmReview');return
false;"
And also added a "return false;" to my Js function
But none of them worked, and the form is still submitted.
-----Message d'origine-----
De : Jana Parvanova [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 1 février 2006 14:39
À : MyFaces Discussion
Objet : Re: Prevent CommandLink from submitting a form
Have you tried adding "return false;" to the "onclick" attribite?
(<x:CommandLink onclick="xxx;return false;")
----- Original Message -----
From: "Jecker Frederic (LFR)" <[EMAIL PROTECTED]>
To: "MyFaces Discussion" <users@myfaces.apache.org>
Sent: Wednesday, February 01, 2006 3:29 PM
Subject: Prevent CommandLink from submitting a form
Hi all,
I use a CommandLink tag to trigger a javascript (<x:CommandLink
onclick="xxx") function which displays as CSS confirm-like dialog.
The javascript function is lauched and the popup is displayed, that's fine
except that immediately after
the js function is fnished, the form is submitted and refreshed, and the CSS
popup is again hidden.
How could I prevent this beahvior and avoir to submit the form once the
onclick action is finished ?
Thanx