Solved

window.history.back(-1) question

Posted on 2001-07-06
4
215 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now