Hi again Spewn,
Thanks once more.
Have tried to cut long coding short … Hope I haven’t left out anything essential in the abbreviated examples below!
The FORM1.html (below) page runs fine. It validates, submits/mails, cancels and resets.
<HTML>
<HEAD>
<TITLE>Order Form</TITLE>
<SCRIPT language=JavaScript>
<!--
function validateForm()
{
if (document.order.name.value == ""

{
alert ("Please Enter Your Name"

;
document.order.name.focus()
return false;
}
// end name if
// end validateForm()
}
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#3300ff" vlink="#990099" alink="#ff0000">
<form method=post name=order onsubmit="return validateForm();" action="mailto:xxxxx@etc?subject=order" enctype="text/plain">
<table width="85%" align="center"border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%">
<p><b><font face="Times New Roman" size="3">Full Name</font></b></p></td>
<td>
<p><input type="text" name="name" size="25" maxlength="25"></p>
</td>
</tr>
</table>
<table width="85%">
<tr>
<td>
<p align="center"><input type="submit" name="submit"value="Submit">
<input type="reset" name="reset" value="Reset"></p>
</td>
</tr>
</table>
</form>
</body>
</HTML>
-------------------------------------------
THANKS.html
<HTML>
<HEAD>
<TITLE>Thanks</TITLE>
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#3300ff" vlink="#990099" alink="#ff0000">
<table width="85%" align="center"border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%">
<p align="center"><b><font face="Times New Roman" size="3">Thank You!</font></b></p></td>
<td>
</tr>
</table>
</body>
</HTML>
-----------------------------------------------------
What I’m wanting to happen : When the user clicks the submit button ...
1. the form is validated using the validateForm function, before displaying the submit or cancel option.
2.if the user clicks OK to submit the form, the form is submitted/mailed and the confirmatory page (thanks.html) is displayed, replacing the form.
3. but if the user cancels the submission, then the submission/mailing is cancelled and the completed form stays displayed.
--------------------
My attempts at a submitForm function have resulted in - if a field was missed/wrong the error message would display, but then immediately change to the submit/mail "popup" without chance of making an entry in the field box. I abandonded this idea.
------------------------------------------------
These are the two “almost there” versions I have tagged on to the end of the validateForm function for the pages I’m actually using. I've tried to explain what happens with each ... hope I've explained clearly.
VERSION 1
if(!confirm("Press OK To Proceed, Or Press Cancel To abort the submission"

) history.go(0);
else
{
location.href=thanks.html';
}
All works to plan if the user ok's. They then get the "you are about to email" popup and on ok-ing that the form submits/mails and the required thanks.html page replaces the form.
BUT if the user cancels, the "you are about to email" popup still displays and they have to cancel again. I wanted to avoid this and managed it in …
VERSION 2 ...
if (confirm("You are about to e-mail your order. Click OK to continue. Click Cancel to abort."

)
{
location.href=thanks.html';
}
else
{
alert("\n Your order has been cancelled."

;
return false;
}
… and the cancel cancels fine on the first message.
OK works fine... puts up the "you are about to email" popup and ok-ing that submits/mails the form and the finish.html page replaces the form.
BUT if the user cancels the submission at this ("you are about to email" popup) stage the thanks.html page is still displayed instead of the form remaining on screen.
Thanks as always ...
LRH