Carry two values from Radio value...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    Carry two values from Radio value...

    Hi,

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

    ..... type=Radio Checked name=selectseri al value=" &
    RS("PSL_F_Seria l").....

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

    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
  • Ray Costanzo [MVP]

    #2
    Re: Carry two values from Radio value...

    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="selectser ial" value="<%=sValu es%>">
    %>

    <%
    aValues = Split(Request.F orm("selectseri al"), "|")
    %>

    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="selectser ial" value="hiddenFi eld1">

    <input type="hidden" name="hiddenFie ld1"
    value="<%=RS.Fi elds.Item("PSL_ F_Serial").Valu e%>">
    <input type="hidden" name="hiddenFie ld1"
    value="<%=RS.Fi elds.Item("PSL_ L_Serial").Valu e%>">

    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" <david@scene-double.co.uk> wrote in message
    news:c178e3e8.0 410210817.47ae2 b55@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > I have an ASP page with a form and the following code:
    >
    > .... type=Radio Checked name=selectseri al value=" &
    > RS("PSL_F_Seria l").....
    >
    > Tis will carry over the value of RS("PSL_F_Seria l"), but I also have
    > another value which needs to be carried (2 values per radio button),
    > RS("PSL_L_Seria l").
    >
    > 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[/color]


    Comment

    Working...