By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,473 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,473 IT Pros & Developers. It's quick & easy.

How to retain values in text box after submit

P: 27
Hi,
I am creating a web page using ASP and Javascript.
When submit button is clicked , It will search for the values in the input given(in the input box).
How to retain the values in the input box after the submit button is clicked



Thanks in advance
Oct 31 '07 #1
Share this Question
Share on Google+
10 Replies


acoder
Expert Mod 15k+
P: 16,027
Does the page submit back to the same page?

Just use ASP to populate the text box with the input from the previous page.
Oct 31 '07 #2

P: 27
Hi ,

Yes the page is submitted back to the same page and the values which are retrieved from the databases are displayed in the same page.


Here i am using a input box and list box. In input text box i will enter values and retrieve values from the DB. Using List box,if we select a value from the list box and using a submit button which will select values for that query and display the result in the same page.

Also the query selection part has been done in the ASP part.

Thanks in advance
Nov 1 '07 #3

dmjpro
100+
P: 2,476
Hi,
I am creating a web page using ASP and Javascript.
When submit button is clicked , It will search for the values in the input given(in the input box).
How to retain the values in the input box after the submit button is clicked



Thanks in advance
Where you want to restore the text value after page submission?

Debasis
Nov 1 '07 #4

P: 27
The values which I retrieve from the database using ASP will be displayed in the same page in the table format and the Text boxex are displayed in the top and the retrieved values in the Table format in the down.
Nov 1 '07 #5

dmjpro
100+
P: 2,476
The values which I retrieve from the database using ASP will be displayed in the same page in the table format and the Text boxex are displayed in the top and the retrieved values in the Table format in the down.
So you want to retrieve the text value in Server Side.
So use Server side script ..... what acode said to do

Debasis ...
Nov 1 '07 #6

acoder
Expert Mod 15k+
P: 16,027
The values which I retrieve from the database using ASP will be displayed in the same page in the table format and the Text boxex are displayed in the top and the retrieved values in the Table format in the down.
Try something like
Expand|Select|Wrap|Line Numbers
  1. <input name="text1" type="text" value="<%=Request.QueryString("text1")%>">
Nov 1 '07 #7

P: 27
Hi Acoder,
I tried with the options u specified but its not working :(.....

Thanks for ur suggestion.
Nov 2 '07 #8

acoder
Expert Mod 15k+
P: 16,027
Are you using GET or POST to submit the data?
Nov 2 '07 #9

P: 27
Are you using GET or POST to submit the data?
I am using post in my coding
Nov 2 '07 #10

acoder
Expert Mod 15k+
P: 16,027
I am using post in my coding
Then you'd be looking for Request.Form I think.

Whatever you've used in your query to retrieve the value of the text box, you'd use that to populate the text box again. Of course, since you're on the same page, it be undefined (before the submit), so you should check for that to prevent errors.
Nov 2 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.