Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javascript dialogbox and html:form action problem

843838Dec 11 2005 — edited Dec 11 2005
i have the following js code:
<SCRIPT>
<!--
function go_there()
{
 var where_to= confirm("Do you really want to go to this page??");
 if (where_to== true)
 {
   window.location="http://yourplace.com/yourpage.htm";
 }
 else
 {
  window.location="http://www.google.com";
  }
}
//-->
</SCRIPT>
and the following code:
<html:form action="/addCust.do" method="post">
		<P><html:submit property="custName" value="Submit" onClick="go_there();" />		
The dialog box works OK but the form:action overrides it (i.e. it should redirect to http://www.google.com if i click no. But this doesn't seem to be the case. Is there a possible way to get both the js dialog box to work and submit it to the addCust.do page if the user selects yes?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2006
Added on Dec 11 2005
1 comment
93 views