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

Retrieve request id

Status
Not open for further replies.

meldrape

Programmer
May 12, 2001
516
US
Hi there,

I have a form with a series of input boxes like so:
<input type=text name=1 id=x1>

How do I retrieve the value using the id instead of the name? I only need to know if the id is null. Thanks in advance.
 
To do a select from the db go here:
and click SELECT

If you want to know if the form text box is empty then do this
Code:
If Request.Form(&quot;1&quot;) = &quot;&quot; then
'# its empty, do something
    Else
'# its not empty..
End if
www.vzio.com
ASP WEB DEVELOPMENT
 
Thanks for your speedy reply. It's actually deeper than that. The text boxes are on a test and I use the same dynamic answer key for each test. Each test could have as many as 10 questions. I use the ID on the test form because let's say the answer to #1 could actually have 7 parts, each box with an id of &quot;x1&quot;. I use the ID for the user to jump from text box to text box. I thought I could perhaps use the id for something else as well. Thanks anyway.
 
You can do a loop, and request all text boxes that way..
Code:
<%

For i=1 to 10 

  strTextBoxes = strTextBoxes & &quot;|&quot; & Request.Form(&quot;name&quot; & i)

Next

%>

The split all the values into an array

txtAllVals = Split(strTextBoxes, &quot;|&quot;)

Then your values will be an array..

Response.Write txtAllVals(0)
..etc






www.vzio.com
ASP WEB DEVELOPMENT



 
Thanks, Snow! I'll give that a try. Since I have commas and some spaces hidden in the answer string so their answers will come out correctly, I have done a &quot;replace&quot; on the answer string, so your idea should work quite nicely.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top