You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "rinkeh@home.nl" <ri...@home.nl> on 2004/03/23 10:40:11 UTC
"are you sure?"
Hi list,
Still a struts newbie, I try to write an "are you sure" javascript
confirmation box for my submit button.
The question is: how can I prevent the form from being submitted
when the user clicks "no"?
In the Jsp, I put the following code in the head:
<SCRIPT LANGUAGE="javascript">
function areyousure(){
var agree = false;
agree = confirm("are you sure?");
if(agree){
... some code which is not important
}
return agree;
}
</SCRIPT>
And the form tag looks like this:
<html:form action="/adddate"
name="dateForm"
type="nl.rinke.DateForm"
onsubmit="areyousure()" >
Whatever the user clicks, yes or no, the form
gets submitted. I want to stop submitting the
form when the user click "no".
thanks, Rinke
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: "are you sure?"
Posted by br...@tcs.com.
Hi rinkie,
You can use a button instead. call the javascript method on the onclick
event of the button. donot use submit use a button.
Brati Sankar Ghosh
Tata Consultancy Services
Mailto: brati.sankarghosh@tcs.com
Website: http://www.tcs.com
"rinkeh@home.nl" <ri...@home.nl>
03/23/2004 03:10 PM
Please respond to
"Struts Users Mailing List" <st...@jakarta.apache.org>
To
struts-user@jakarta.apache.org
cc
Subject
"are you sure?"
Hi list,
Still a struts newbie, I try to write an "are you sure" javascript
confirmation box for my submit button.
The question is: how can I prevent the form from being submitted
when the user clicks "no"?
In the Jsp, I put the following code in the head:
<SCRIPT LANGUAGE="javascript">
function areyousure(){
var agree = false;
agree = confirm("are you sure?");
if(agree){
... some code which is not important
}
return agree;
}
</SCRIPT>
And the form tag looks like this:
<html:form action="/adddate"
name="dateForm"
type="nl.rinke.DateForm"
onsubmit="areyousure()" >
Whatever the user clicks, yes or no, the form
gets submitted. I want to stop submitting the
form when the user click "no".
thanks, Rinke
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
ForwardSourceID:NT00002C0E
RE: "are you sure?"
Posted by Lokanath <lo...@molecularconnections.com>.
hi
u can try this
<html:form action="/adddate"
name="dateForm"
type="nl.rinke.DateForm"
onsubmit="return confirm('areyousure')" >
this is working 4 me
-----Original Message-----
From: rinkeh@home.nl [mailto:rinkeh@home.nl]
Sent: Tuesday, March 23, 2004 1:40 AM
To: struts-user@jakarta.apache.org
Subject: "are you sure?"
Hi list,
Still a struts newbie, I try to write an "are you sure" javascript
confirmation box for my submit button.
The question is: how can I prevent the form from being submitted
when the user clicks "no"?
In the Jsp, I put the following code in the head:
<SCRIPT LANGUAGE="javascript">
function areyousure(){
var agree = false;
agree = confirm("are you sure?");
if(agree){
... some code which is not important
}
return agree;
}
</SCRIPT>
And the form tag looks like this:
<html:form action="/adddate"
name="dateForm"
type="nl.rinke.DateForm"
onsubmit="areyousure()" >
Whatever the user clicks, yes or no, the form
gets submitted. I want to stop submitting the
form when the user click "no".
thanks, Rinke
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org