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

not able to use request.form("") to see calling form info

Status
Not open for further replies.

idono

Technical User
Jan 16, 2002
71
US
I'm using the below code to view items selected from a multiple list on one page. I cannot write the information to screen or to the textbox. Please advise.

<% LANGUAGE=&quot;VBSCRIPT&quot; %>


<form name=&quot;Suggestion&quot; method=&quot;Post&quot; action=&quot;confirm.asp&quot;>
<table>
<tr><td>Suggestors: </td>
<td><input type=&quot;text&quot; name=&quot;FirstName&quot; size=&quot;50&quot;></td></tr>
<tr><td>Last Name: </td>
<td><input type=&quot;text&quot; name=&quot;LastName&quot; size=&quot;50&quot;></td></tr>
<tr><td>Comments: </td>
<td><textarea cols=&quot;50&quot; name=&quot;Comments&quot; ></textarea></td></tr>
</table>

<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>

<%
Suggestor = Request.form(&quot;Suggestor&quot;)
%>

 
<% LANGUAGE=&quot;VBSCRIPT&quot; %>
to
<%@ LANGUAGE=&quot;VBSCRIPT&quot; %>

but the main thing is you're not looping throught he collection
you need to do a
for each item in Request.Form
response.write Request.Form(item)
loop

that's about the simplest method to get all the passed objects

1H 1K 10 3D 3F 3E 3K 38 3J 10 1T 10 3G 3L 3I 35 10 35 3O 33 35 3C 3C 35 3E 33 35

brickyard.jpeg
Most intense event I ever attended!
 
Gotcha (-:
for each item in Request.Form
response.write Request.Form(item & &quot;<br>&quot;)
NEXT
Go have coffee.
 
[lol]

I'm cloudy sick sniffling coughing and all the fun stuff that goes along with a cold.

I think I'll take you up on that coffee though and go get some.

1H 1K 10 3D 3F 3E 3K 38 3J 10 1T 10 3G 3L 3I 35 10 35 3O 33 35 3C 3C 35 3E 33 35

brickyard.jpeg
Most intense event I ever attended!
 
Thank you for the responses, but I think something else is wrong? I can use Response.Write to put anything I want on the page. But when I call anything from Request.Form I get nothing. What do you suppose would make the Request.Form information null/blank/empty?
 
it not being submitted!

try this and see if you get anything
(all one page)

<html>
<head>
<script language=&quot;javascript&quot;>
function subChg() {
document.Suggestion.hid.value=&quot;submitted&quot;;
}
</script>
</head>
<body>
<%
If Request.Form(&quot;hid&quot;) = &quot;submitted&quot; Then
Response.Write &quot;The following values were submitted via HTTP<br>&quot;
for each item in Request.Form
response.write Request.Form(item) & &quot;<br>&quot;
next

Else
%>
<form name=&quot;Suggestion&quot; method=&quot;Post&quot; action=&quot;confirm.asp&quot; onSubmit=&quot;return subChg()&quot;>
<input type=&quot;hidden&quot; name=&quot;hid&quot;>
<table>
<tr><td>Suggestors: </td>
<td><input type=&quot;text&quot; name=&quot;FirstName&quot; size=&quot;50&quot;></td></tr>
<tr><td>Last Name: </td>
<td><input type=&quot;text&quot; name=&quot;LastName&quot; size=&quot;50&quot;></td></tr>
<tr><td>Comments: </td>
<td><textarea cols=&quot;50&quot; name=&quot;Comments&quot; ></textarea></td></tr>
</table>

<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>

<%
End If
%>
</body>
</html>

1H 1K 10 3D 3F 3E 3K 38 3J 10 1T 10 3G 3L 3I 35 10 35 3O 33 35 3C 3C 35 3E 33 35

brickyard.jpeg
Most intense event I ever attended!
 
It went to the else part!
 
after you submitted it?

1H 1K 10 3D 3F 3E 3K 38 3J 10 1T 10 3G 3L 3I 35 10 35 3O 33 35 3C 3C 35 3E 33 35

brickyard.jpeg
Most intense event I ever attended!
 
Yes, after I hit the next button on the first page this page displayed the else portion of your code.
 
It is a IIS setting then/ I can't remember where the HTTP post setting is off the top of my head but i'll post it back if anyone else does not

1H 1K 10 3D 3F 3E 3K 38 3J 10 1T 10 3G 3L 3I 35 10 35 3O 33 35 3C 3C 35 3E 33 35

brickyard.jpeg
Most intense event I ever attended!
 
from what it looks like to me is there's two pages involved, and we're only seeing one of them ?

you can do a response.write request.form() to display the entire post content.

looks like &quot;suggestor&quot; is a field from a prior page? is the prior page method=post? or method=get? if it's method get, you're not going to get request.form values, cause it wasn't posted, it was get'ed meaning you're left with a querystring value.

rule of thumb i've used in the past is during debugging kill the .form and .querystring methods of the request object. cause if the value is retrieveable from either method, request(&quot;suggestor&quot;) will find it in one of the two.

also your text fields aren't populated by means of request values, or DB values, especially if this is the second page of a chain, perhaps you could post some of the code from confirm.asp AND/OR the page that posts to this page you have already supplied

thanks
 
I pulled a rookie mistake. I had the button enclosed in the form tags, but not the multi-select listbox. Therefore, it was not posting the data selected but the value of the button itself. Sorry, it just took some looking at it before it showed up. Thank you for all of your posts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top