467,104 Members | 1,071 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

Carry two values from Radio value...

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
Jul 21 '05 #1
  • viewed: 1520
Share:
1 Reply
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

"David" <da***@scene-double.co.uk> wrote in message
news:c1**************************@posting.google.c om...
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

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.