Solved

window.history.back(-1) question

Posted on 2001-07-06
4
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Glitching Slide Show 19 40
Problem in javascript 17 59
Keyup listener getting fired on initial page load 1 53
Set a parameter in a properties file and use in html table. 14 59
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…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

752 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