my original action for frmOrder was mailto:<A HREF="mailto:thibault@hotbot.com">thibault@hotbot.com</A>, which worked perfectly "onSubmit", even if you never closed the page. i added the emailConfirm() function to the "onUnload" method of the <BODY> assuming that it would alter the action for frmOrder until the user closed the page. that way, if it failed, the original "onSubmit" action would already have been taken and would not be affected.<br>unfortunately, that's not what happened. when i run this the original action(mailto:<A HREF="mailto:thibault@hotbot.com">thibault@hotbot.com</A>) is not executed "onSubmit" as it does normally. how is this possible? any ideas as to what i can do to correct this? code below.<br><br>NOTE: the purpose of the change in the action, upon closing the form, was to send a copy of the order to the person who placed the order.<br>tia<br><br><br><HTML><br><HEAD><br><TITLE>Special Order Form</TITLE><br><br><SCRIPT LANGUAGE="Javascript"><br><br>var vHolder = 0;<br><br> function setFocus() {<br> document.frmOrder.Store.focus(); // set initial focus<br> vDate = new Date(); // set default date<br> vMonth = vDate.getMonth();<br> vMonth = vMonth + 1;<br> if (vMonth<10) vMonth = ("0" + vMonth.toString());<br> vDay = vDate.getDate();<br> if (vDay<10) vDay = ("0" + vDay.toString());<br> vYear = vDate.getYear();<br> sDate = (vMonth + "/" + vDay + "/" + vYear);<br> document.frmOrder.ordDate.value = sDate;<br>}<br><br><br> function checkLoc_cd(vLoc_cd) { // set vLoc_cd to the proper length<br> if (vLoc_cd.length==0) { // check for null field value<br> if (vHolder==0) {<br> vHolder = 1;<br> document.frmOrder.Store.focus();<br> alert("A value must be entered in this field."<br> }<br> }<br> if (vLoc_cd.length==2){ // loc-cd must be 3 characters long<br> vLoc_cd = "0" + vLoc_cd;<br> }<br> else if (vLoc_cd.length==1){<br> vLoc_cd = "00" + vLoc_cd;<br> }<br> document.frmOrder.Store.value = vLoc_cd;<br> vHolder = 0;<br>}<br><br> function checkValue(vValue,vName) { // check for null field value<br> if (vValue.length==0) {<br> if (vHolder==0) {<br> vHolder = 1;<br> alert(vName);<br> val = window.eval("document.frmOrder."+vName+".focus()"<br>/*<br> document.frmOrder.Assoc.focus();<br>*/<br> alert("A value must be entered in this field."<br> }<br> }<br>}<br><br> function submitIt() {<br> vConfirm = document.frmOrder.Assoc.value.substr(0,2);<br> vConfirm = vConfirm.toUpperCase();<br> vConfirm += document.frmOrder.Store.value;<br> vDate = new Date();<br> vAno = vDate.getYear();<br> vYear = vAno.toString();<br> vYear = vYear.substr(2,2);<br> vConfirm += vYear;<br> vMonth = vDate.getMonth();<br> vMonth = vMonth + 1;<br> if (vMonth<10) sMonth = ("0" + vMonth.toString());<br> else sMonth = vMonth.toString();<br> vConfirm += sMonth;<br> vDay = vDate.getDate();<br> if (vDay<10) sDay = ("0" + vDay.toString());<br> else sDay = vDay.toString();<br> vConfirm += sDay;<br><br> vConfirm += vDate.getHours();<br> vConfirm += vDate.getMinutes();<br> document.frmOrder.ConfirmNo.value = vConfirm; // set value of confirmation number<br>}<br><br> function emailConfirm() {<br> vEmail = "mailto:"<br> vEmail += document.frmOrder.Assoc.value;<br> vEmail += "@ultrastores.com";<br> document.frmOrder.action = vEmail;<br> document.frmOrder.submit();<br> alert(vEmail);<br>}<br><br><br></SCRIPT><br></HEAD><br><BODY onLoad="setFocus();" onUnload="emailConfirm();"><br><IMG SRC="ultstore.jpg" align=center HEIGHT=28 WIDTH=180><br><CENTER><H3>SPO Department Inquiry & Order Form</H3></CENTER><br><br><FORM NAME="frmOrder" ACTION="mailto:<A HREF="mailto:thibault@hotbot.com">thibault@hotbot.com</A>" METHOD="POST" ENCTYPE="text/plain"<br> onSubmit="submitIt();"><br> <INPUT TYPE="HIDDEN" NAME="ConfirmNo"><br> <TABLE WIDTH="95%" BORDER=1><br> <TR><TD>Store<BR><INPUT TYPE="TEXT" SIZE=3 NAME="Store" onBlur="checkLoc_cd(value);"></TD><br> <TD>Associate Login ID<BR><INPUT TYPE="TEXT" SIZE="15" NAME="Assoc" onBlur="checkValue(value,name);"></TD><br> <TD>Today's Date<BR><INPUT TYPE="TEXT" SIZE="15" NAME="ordDate" VALUE="6/23/00"></TD><br> <TD COLSPAN=2>Date Order Needed In Store<BR><INPUT TYPE="TEXT" SIZE="15" NAME="Needed" onBlur="checkValue(value,name);"></TD><br> </TR><br> <TR><TD COLSPAN=3>Customer Name<BR><INPUT TYPE="TEXT" SIZE="30" NAME="Guest" onBlur="checkValue(value,name);"></TD><br> <TD ROWSPAN=3 COLSPAN=2><B>One option must be selected<B/><BR><br><br> <INPUT TYPE="RADIO" NAME="RequestType" VALUE="0" >50% DEPOSIT AMOUNT<BR><br> <INPUT TYPE="RADIO" NAME="RequestType" VALUE="1" >PAID IN FULL AMOUNT<BR><br> <INPUT TYPE="RADIO" NAME="RequestType" VALUE="2" >TRANSFER/EXCHANGE<BR><br> <INPUT TYPE="RADIO" NAME="RequestType" VALUE="3" >INQUIRY ONLY<BR><br> </TR><br> <TR><TD COLSPAN=3>Address<BR><INPUT TYPE="TEXT" SIZE="40" NAME="Domicile" onBlur="checkValue(value,name);"></TD><br> </TR><br> <TR><TD COLSPAN=2>Home Phone<BR><INPUT TYPE="TEXT" SIZE="20" NAME="Home" onBlur="checkValue(value,name);"></TD><br> <TD>Work Phone<BR><INPUT TYPE="TEXT" SIZE="20" NAME="Work"></TD><br> </TR><br> <TR><TD>SKU to reference<BR><INPUT TYPE="TEXT" SIZE="15" NAME="SKU" onBlur="checkValue(value,name);"></TD><br> <TD>Metal<BR><INPUT TYPE="TEXT" SIZE="15" NAME="metal" onBlur="checkValue(value,name);"></TD><br> <TD>Color<BR><INPUT TYPE="TEXT" SIZE="15" NAME="color" onBlur="checkValue(value,name);"></TD><br> <TD>Size/Length<BR><INPUT TYPE="TEXT" SIZE="15" NAME="size"></TD><br> <TD>Retail<BR><INPUT TYPE="TEXT" SIZE="15" NAME="retail" onBlur="checkValue(value,name);"></TD><br> </TR><br> <TR><TD COLSPAN=5>Special Instructions<BR><INPUT TYPE="TEXT" SIZE="55" NAME="instructions"></TD><br> </TR><br> <TR><TD COLSPAN=5><br> <INPUT TYPE="submit" VALUE="Submit" ACTION=SUBMIT><br> <INPUT TYPE="reset" VALUE="Reset" ACTION=RESET onClick="setFocus();"><br> </TD><br> </TR><br> </TABLE><br> <FONT FACE="Arial" SIZE=2>Copyright Ultra Stores, Inc. 2000</FONT><br></FORM><br></BODY><br></HTML> <p>bobbie<br><a href=mailto:thibault@hotbot.com>thibault@hotbot.com</a><br><a href= </a><br>