please help with conditional logic

M

Mike

i would appreciate some help
to write a small script to do the following

you may see the current form at

https://secure.compushack.com/complastemail/secure_email.asp

after the client has entered all the info for ITEM 1

when he presses the SUBMIT button

i would like a pop up message saying " Are you done ( Y/N ) ?

if he presses "Y" then the form gets submitted , if he presses "N"

he is taken to the NEXT field in the form to continue shopping.



Reply To : (e-mail address removed)
 
D

David Berry

You could use JavaScript. Ex:

<script LANGUAGE="JavaScript">

function CheckFinished()
{
if (confirm("Are you Done?"))
{
document.forms.FrontPage_Form1.action = "/cgi-bin/mailto.exe";
document.forms.FrontPage_Form1.submit();
}
else
return false;
}

</script>


<input type="button" name="btnSubmit" value="Submit"
ONCLICK="CheckFinished();">
 
M

Mike

thanks a lot !!!





***
***<script LANGUAGE="JavaScript">
***
*** function CheckFinished()
*** {
*** if (confirm("Are you Done?"))
*** {
*** document.forms.FrontPage_Form1.action = "/cgi-bin/mailto.exe";
*** document.forms.FrontPage_Form1.submit();
*** }
*** else
*** return false;
*** }
***
***</script>
***
***
***<input type="button" name="btnSubmit" value="Submit"
***ONCLICK="CheckFinished();">


Reply To : (e-mail address removed)
 
M

Mike

by itself your script works

if i put the script as the last script in the page

the result is that no other data gets validated.

if i put this script as the 1st script in the form

it ALMOST works as if i answer YES, it presents

the 1st validation error " You must enter an e-mail address "

and then it proceeds to submit the form

instead putting the cursor where the data should be entered.


why does it do that ?





***
***<script LANGUAGE="JavaScript">
***
*** function CheckFinished()
*** {
*** if (confirm("Are you Done?"))
*** {
*** document.forms.FrontPage_Form1.action = "/cgi-bin/mailto.exe";
*** document.forms.FrontPage_Form1.submit();
*** }
*** else
*** return false;
*** }
***
***</script>
***
***
***<input type="button" name="btnSubmit" value="Submit"
***ONCLICK="CheckFinished();">


Reply To : (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top