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

form values 1

Status
Not open for further replies.

FreshJava

Programmer
Feb 20, 2002
65
0
0
US
I am creating a dynamic driven survey where the a user can create qustions and is then populated on a local web page for others to cast votes. I have the back end working, my problem is when I try to send form values to the next page to be processed.

i.e
<%
do until rs.eof
%>
<input type="checkbox" name="Answer" Value="<%=rs"value")%>>
<%
rs.movenext
loop
%>
on the processing Page I request the value of Answer it is returned with both seperated by a comma e.g. 14,15

Answer = request.form("Answer")

I need both values individually but not sure how to go about it to increment the count in the database.
14 represents one record and 15 represents another

any Ideas would be greatly appreciated

Thanks
 
Huh? I really dont understand what you are asking here! Plus this line is incorrect for a start and would produce an error:

Code:
<input type="checkbox" name="Answer" Value="<%=rs"value")%>>

Sorry but can you be a little more clear

Nick
 
The error is a missing parenthesis.

The reason for the comma separated values is that multiple HTML form elements have the same name on the survey page.

One good way to deal with comma separated values is the Split function that converts a string into an array... you might need to use Replace first to get rid of the space characters by replacing them with empty strings. After the split you can make a For/Next loop to iterate through the array elements.
 
Oops - seems as though I did indeed leave the left parenthesis; however it was meant only to get the point across which Sheco obviously got.

Thanks Sheco that is exactly what I was looking for. I'm still somewhat of a novice programmer, and have never used the split function. Worked perfectly!
Thanks again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top