Hi,
I have 2 asp pages. When I click submit in page1, it go to page2. Page2 validate a value (invoice#) that was input in page1. If it's not a good invoice#, then I redirect back to page1 (with the error flag and invoice# append to url).
In the beginning of page1, I check the error flag. If found I pop up the alert box.
Problem is here. After I get alert box, I changed the invoice# to a good number and click submit to go to page2. If I click cancel from page 2 to go back to page1, the alert box will pop up. So it seem like when I go back to page1, the error flag that I pass ealier still there. How do I reset it.
This is code for my cancel botton.
Thanks
I have 2 asp pages. When I click submit in page1, it go to page2. Page2 validate a value (invoice#) that was input in page1. If it's not a good invoice#, then I redirect back to page1 (with the error flag and invoice# append to url).
Code:
newurl = "page1.asp?errflag=1&invnumber=" + strinvnumber
Response.redirect newurl
Code:
<script type="text/javascript" defer>
<!--
strflag = "<%=Request.Querystring("errflag")%>";
strinvnumber = "<%=Request.Querystring("invnumber")%>";
if (strflag != "")
{
errflag = "";
errmsg = "Invoice# " + strinvnumber + " already exist but not miscelleous invoice. Change not allowed";
alert (errmsg);
}
This is code for my cancel botton.
Code:
<td align="right"><a href="javascript:history.go(-1)"><img src="images/cancel.gif" border="0"></a></td>
Thanks