Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass the value when submit the form

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
hi guys.

I have an asp page in which i do html coding and processing, mean that the processing and html file is the same file. the problem is when i submit the form, the data which previously typed will be gone and the form was refresh. How to make the previous data stay there?

thanks a lot
RoNaDia
 
Hello,
Try using this technique:
file getpost.asp
<html>
<body>
<FORM NAME=&quot;myForm&quot; ACTION=&quot;getpost.asp&quot; METHOD=&quot;post&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;Text&quot; VALUE=&quot;<%= Request.Form(&quot;Text&quot;) %>&quot;>
<INPUT TYPE=&quot;submit&quot; VALUE=&quot;Use Post&quot;>
</FORM>
<% If Request.Form(&quot;Text&quot;) <> &quot;&quot; Then %>
The text in the box was <%= Request.Form(&quot;Text&quot;) %>
<% End If %>
</body>
</html>

If you need default value then you could try longer expression in VALUE like:
<% If (Request.Form(&quot;Text&quot;) = &quot;&quot;) Then Response.Write(&quot;Default value&quot;) Else Response.Write(Request.Form(&quot;Text&quot;)) %>

Hope this helps.
D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top