Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript Buttons in a confirmation asp page

Status
Not open for further replies.

buspass01

Programmer
Nov 18, 2002
5
US
I am creating a webpage that the opening page is a form. When you click the submit button on the form you go to the receiveorderform.asp that returns the values entered in the form on the opening page...

I need help creating a code for the receiveorderform.asp which includes a confirm button that takes the visitor to a Thank you for ordering page and a button that cancels the order and wipes out the values enter in the form and returns them to the first page. Below is the code for the
receiveorderform.asp page

Thanks in advance!


<%@LANGUAGE=&quot;JAVASCRIPT&quot; CODEPAGE=&quot;CP_ACP&quot;%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<%

function confirmReset() {
var resetForm = confirm(
&quot;Are you sure you want to reset the form?&quot;);
if (resetForm == true)
return true;
return false;
}

%>
</head>

<body>
<H2> Products Ordered:</H2>
<P>Hammers Ordered: <%= Request.Form(&quot;hammers&quot;) %></P>
<P>Clamps Ordered: <%= Request.Form(&quot;clamps&quot;) %></P>
<P>Torches Ordered: <%= Request.Form(&quot;torches&quot;) %></P>
<P>Axes Ordered: <%= Request.Form(&quot;axes&quot;) %></P>
<P>Name: <%= Request.Form(&quot;chisels&quot;) %></P>
<H2>Billing Information:</H2>
<P>Name: <%= Request.Form(&quot;name&quot;) %></P>
<P>Billing Address: <%= Request.Form(&quot;address&quot;) %></P>
<P>Shipping Address: <%= Request.Form(&quot;address2&quot;) %></P>
<P>City: <%= Request.Form(&quot;city&quot;) %></P>
<P>State: <%= Request.Form(&quot;state&quot;) %></P>
<P>Zip: <%= Request.Form(&quot;zip&quot;) %></P>
<P>Phone Number: <%= Request.Form(&quot;phone&quot;) %></P>
<P>Email Address: <%= Request.Form(&quot;email&quot;) %></P>
<P>Credit Card Type: <%= Request.Form(&quot;creditcard&quot;) %></P>
<P>Credit Card Number: <%= Request.Form(&quot;ccnum&quot;) %></P>
<P>Expiration Date: <%= Request.Form(&quot;expdate&quot;) %></P>
<FORM ACTION=&quot;file:///C|/MyWebSites/INFO250/Exercise10/Tutorial.10/thankyou.htm&quot; METHOD=&quot;post&quot; ENCTYPE=&quot;type/plain&quot; NAME=&quot;secpage&quot;
onSubmit=&quot;return submitForm();&quot;
onReset=&quot;return confirmReset();&quot;>
<INPUT TYPE=&quot;button&quot; NAME=&quot;cancel_button&quot; Value=&quot;Cancel&quot;>
<INPUT TYPE=&quot;button&quot; NAME=&quot;confirm_button&quot; Value=&quot;Confirm&quot;></form>
</body>
</html>
 

how about...

***<script>

function confirmReset() {

var answer=confirm(&quot;do you want to reset?&quot;)
if(answer) window.location=&quot;index.html&quot;

}

</script>



<FORM METHOD=&quot;post&quot; ACTION=&quot;file:///C|/MyWebSites/INFO250/Exercise10/Tutorial.10/thankyou.htm&quot; ENCTYPE=&quot;type/plain&quot; NAME=&quot;secpage&quot; onReset=&quot;confirmReset();&quot;>
<INPUT TYPE=reset NAME=&quot;cancel_button&quot; Value=&quot;Cancel&quot;>
<INPUT TYPE=submit NAME=&quot;confirm_button&quot; Value=&quot;Confirm&quot;>
</form>
***

does that help?

- g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top