Solved

Retain textbox value after submit

Posted on 2004-09-29
5
1,008 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how would you interpret lines 3 36
Why my select dropdown does not work? 8 40
What am I doing wrong with this Lightbox widget? 6 33
PHP Form Calculate Total Price 10 40
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…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

816 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

12 Experts available now in Live!

Get 1:1 Help Now