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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to extract text from an ASP 1

Status
Not open for further replies.

aojonesoa

Technical User
Apr 25, 2001
40
US
I have an ASP which returns a page to the browser that has some of the same information typed into an input text field on the previous form.

Does anyone know how to extract the text that was returned to the browser? I need to set the value of a hidden input with it when the ASP page loads.

My problem is that the text returned by the ASP is not an object anymore, it's just text, so how do I reference something that's not an object? >:):O>
 
Well, you could recrea it thru JavScript when the asp page returns - by writing in the Javascript too. So do you mnea you need to set a value in a form, after submission to an asp page? You could do something like:

<%
hiddenValue = Request.QueryString(&quot;someValue&quot;)
Response.write &quot;onLoad='document.form.hiddenValue=&quot; &hiddenValue &&quot;'&quot;
%>


If you put something like that in onLoad, in <body>, then the appropriate value will be set, assuming the value is sent form the last asp.
b2 - benbiddington@surf4nix.com
 
Or you could streamline it a little:
Code:
<input type=&quot;hidden&quot; name=&quot;bob value=&quot;<% Request.QueryString(&quot;bob&quot;)%>
 
Oops, it'll need to be &quot;<%=&quot;, not &quot;<%&quot;
 
Here's what I did:
1. Created a new page and labeled it testasp.htm (I also tried testasp.asp).
2. Put a form in the page with the following input:
<input type=&quot;text&quot; name=&quot;TestInput&quot;>
3. Added the following at the form tag:
<form method=&quot;POST&quot; action=&quot;4. Created a new page and called it testasp2.asp
5. Added the following:
<input type=&quot;text&quot; name=&quot;T1&quot; value=<%=Request.QueryString(&quot;TestInput&quot;)%>>

The second page comes up with a blank input box.

As you can see, I am relatively new to ASP, but could you put me back on the right path?

Thanks,
Scott:)
 
request.querystring is for 'method=get'

request.form is for 'method=post'

try request.form -- that should fix you up

:)
Paul Prewett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top