ok!
thanks for being patient:D
Then, The onclick should be Onclick="return check(blah)"
--Doug
-----Original Message----- From: Slawek [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:21 PM To: MyFaces Discussion Subject: Re: JavaScript-Confirm inside a commandlink?
thats what i understod reading your posts BUT in my 2 separated projects it alwasy submits :|
what could i fu**ed up?
Sławek
Well, If your confirm function returns false when the user clicks on cancel, the form will not be submitted.
--Doug
-----Original Message----- From: Slawek [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 1:28 PM To: myfaces-user@incubator.apache.org Subject: Re: JavaScript-Confirm inside a commandlink?
please explain me as i would be an idiot:D //=============================================== <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%> <html> <head> <script language="javaScript"> function clik(){ a=confirm('sure?'); if (a) return true; return false; } </script> </head> <body> <f:view> <h:form > <x:commandButton onclick="clik()" action="#{bean.action}" value="aa" /> </h:form> </f:view> </body> </html> //=========================================================== when user answer cancel on confirm JS window should form be submitted or
not?