history.back()

A

Alan

I have a form that contains many fields for the user to enter. After
entering the data the user can click a link to open a new window, the
new window contains six columns (pull down menu) and 30 rows to allow
user choose their options.

<SCRIPT LANGUAGE="JavaScript">
function win(QID) {
msg=window.open("QuotationPE.asp?QID=" + QID
,"","height=600,width=800,left=80,top=80, scrollbars=yes");
}
</script>
........
QID = "200510001"
<a href="javascript:win(<%=QID%>)">

After finished, the new window saves the data to a txt file, closes
itself and return to the main page.

Response.Write("<script language='javascript'>")
Response.Write("parent.window.close();")
Response.Write("</script>")

Then the user click the submit button in the main page, all the values
in the main page will post to a print preview and save to a database,
everything ok, but before save, I allow user to go back and make
changes from the previous main page. However, when "history.back()" to
the previous main page, all the submitted values lost.

How can my "onclick = history.back()" button tell the browser to retain
the previously submitted values so the user doesn't have to re-enter
everything?

Thanks
 
E

Evertjan.

Alan wrote on 29 dec 2005 in microsoft.public.inetserver.asp.general:
<SCRIPT LANGUAGE="JavaScript">
function win(QID) {
msg=window.open("QuotationPE.asp?QID=" + QID
,"","height=600,width=800,left=80,top=80, scrollbars=yes");
}
</script>
.......
QID = "200510001"
<a href="javascript:win(<%=QID%>)">

After finished, the new window saves the data to a txt file, closes
itself and return to the main page.

Response.Write("<script language='javascript'>")
Response.Write("parent.window.close();")
Response.Write("</script>")

1 Your question is only clientside javascript related.
The fact that it is packed in a bit of ASP code does not warant an
answer in this NG.

2 The little ASP in it is incorrect:
QID = "200510001"
<a href="javascript:win(<%=QID%>)">

should be:

<%
QID = "200510001"
%>

after all QID is a serverside variable, and

<a href="javascript:win('<%=QID%>')">

if you don't want to risk the error prone
string to number to string conversion.

3 I surmize you ment:

"20051001" ?
 
S

s_goose

Alan, just put a Response.Expires=100 (or something different from 0)
at the beginning of the code of the page) and u will not more loose the
value when u call the history.back.


Bye
Goose

Alan ha scritto:
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top