Solved

window.history.back(-1) question

Posted on 2001-07-06
4
224 Views
Last Modified: 2012-06-21
I have a text input box in a form which, when the submit button is pressed, calls an ASP page for processing.  When the processing is complete,  I use window.history.back(-1) to go back to the page with the form, is there any  way that I can have the text input box automatically clear its contents when it is displayed again?
0
Comment
Question by:Chris_m
  • 2
4 Comments
 

Expert Comment

by:ianlesoft
ID: 6258723
yes, you can use ASP command "expire" of the page
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6258836
Just replace the streings with the correct names

function document_onload()
{
   document.forms["formname"]["textboxname"].value="";
}

window.onload=document_onload;

Regards,
CJ
0
 

Author Comment

by:Chris_m
ID: 6258912
For ianlesoft:
I am not sure how to ue the expire command
for CJ S:
that would work fine except that the Input box is initially populated with a value obtained from a SELECT box on another ASP page
<INPUT ID="NameAfterChange" NAME="selectedName" VALUE="<%Response.Write(Request.Form("selectedName"))%>">
and if I use your code, the initial value is also cleared.  I only want the box to be cleared when I return to it, not when I initialy go to it.
regards
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
ID: 6258927
function document_onload()
{
  if(document.forms["formname"]["textboxname"].value!="<%=Request.Form("selectedName")%>")
    document.forms["formname"]["textboxname"].value="";
}
window.onload=document_onload;
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question