Solved

Retain textbox value after submit

Posted on 2004-09-29
5
1,007 Views
Last Modified: 2008-03-10
I'm sure this is simple, but eludes me.

I have one text box. After I submit the page -
document.demo.method="get";
document.demo.submit();

I wish to retain the value in the textbox after the page is submitted. The page is an asp page and is submitted to iteslef.

TQ
0
Comment
Question by:Malek103197
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:cLFlaVA
ID: 12179634
This can be done best using ASP, not JavaScript.

I don't know ASP, but it would look something like this:

<input type="text" name="the_textbox" value="<% however_you_reference_the.get_variable %>">
0
 
LVL 15

Accepted Solution

by:
Colosseo earned 125 total points
ID: 12179685
Hi

Because you are submitting the form using get you need to use request.querystring

so the value property for your text field would be

value="<%=Request.QueryString("[the textfield name]")%>"

HTH

Scott
0
 

Author Comment

by:Malek103197
ID: 12179876
Colosseo,

Thanks, that did the trick.
0
 
LVL 15

Expert Comment

by:Colosseo
ID: 12179893
no bother Malek glad to help

Cheers

Scott
0
 
LVL 13

Expert Comment

by:cLFlaVA
ID: 12180442
awesome.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
count download link and run update query 9 56
CSS Scroll Issue 3 90
Don't understand jquery promises 6 37
Recordset containing single quotes 8 23
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

920 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

14 Experts available now in Live!

Get 1:1 Help Now