Click to See Complete Forum and Search --> : holding the value after refresh
andrew_hkh
04-01-2005, 04:22 AM
when i select a value from the drop down list, the following textbox will display the value that related to the value from drop down list. But once i select it, the page will refresh automatically, then the textbox value that i type in manually will disappear. Any solution can solve it? thanks..
phpnovice
04-01-2005, 09:15 AM
Your ASP page would have to send the field value back with the HTML value attribute filled in as follows:
<input type="text" name="myText" size="10" value="<%=Request.Form("myText")%>">
Or, do you mean when the visitor clicks the browser's [Refresh] button? Normally, this would also invoke your ASP code and it could do as above -- unless the form has not been submitted even once, yet. In that case, if the drop-down option is remaining selected, then only JavaScript can help you.
You probably need to explin further just what is the mechanics of this "refresh" you're talking about -- and why you add the word "manually".
andrew_hkh
04-01-2005, 08:37 PM
Thanks for your reply.
What i mean is when the listbox is selected, the web page will refresh itself. i need to retrieve the data from the database to display on textbox. The listbox that i create is act like a submit button. As you know, when the webpage is refresh, the value which is entered by the visitor in the textbox will disappeared, except some of the textbox that are bounded with database.
andrew_hkh
04-02-2005, 12:39 AM
I have successful retain the textbox value using your sample. Thank you very much!!!!
:)
phpnovice
04-02-2005, 10:22 AM
Cheers.