Carry two values from Radio value...

D

David

Hi,

I have an ASP page with a form and the following code:

..... type=Radio Checked name=selectserial value=" &
RS("PSL_F_Serial").....

Tis will carry over the value of RS("PSL_F_Serial"), but I also have
another value which needs to be carried (2 values per radio button),
RS("PSL_L_Serial").

Can I send two sets of data this way, if so, how?

If this is possible, on the next page, how can I retrieve both values
into seperate variables ?


Appreciate your help


David
 
R

Ray Costanzo [MVP]

You could delimit the values and then split them.

<%
sValues = RS.Fields.Item("PSL_F_Serial").Value & "|" &
RS.Fields.Item("PSL_L_Serial").Value
<input type="radio" name="selectserial" value="<%=sValues%>">
%>

<%
aValues = Split(Request.Form("selectserial"), "|")
%>

You don't have to use a | character. Just use something that cannot be in
value of that column in the database ever.


Another option is to do something like:

<input type="radio" name="selectserial" value="hiddenField1">

<input type="hidden" name="hiddenField1"
value="<%=RS.Fields.Item("PSL_F_Serial").Value%>">
<input type="hidden" name="hiddenField1"
value="<%=RS.Fields.Item("PSL_L_Serial").Value%>">

Witht that, the radio button is actually "telling" your code which hidden
inputs to read values from. There would be two hidden inputs for each radio
button. The hidden input pairs would have the same name, so the values
would be returned separated by a comma and a space.

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top