Force a radio button selection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill via DotNetMonster.com

    Force a radio button selection


    Hi

    I have a RadioButtonList and the value of each radio button is an image.

    How can I arrange it so that clicking on an image selects the corresponding
    radio button?

    Thanks

    Bill

    <asp:RadioButto nList id="payment" runat="server"
    RepeatDirection ="Horizontal ">
    <asp:ListItem>< a href="javascrip t:selRadioButto n(0);"><img
    src=images/Mastercard.png width="26" height="16" border="0"
    alt="Mastercard &reg;"></a>&nbsp;&nbsp; </asp:ListItem>
    <asp:ListItem>< img src=images/Visa.jpg width="25" height="16"
    border="0" alt="Visa&reg;" >&nbsp;&nbsp; </asp:ListItem>
    <asp:ListItem>< img src=images/Bankcard.jpg width="25"
    height="16" border="0" alt="Bankcard&r eg;"></asp:ListItem>
    </asp:RadioButton List>

    --
    Message posted via http://www.dotnetmonster.com
  • Bill via DotNetMonster.com

    #2
    Re: Force a radio button selection

    Trivial question, sorry. The answer is simply:

    function selRadioButton( i) {
    document.member details.payment[i].checked=true;
    }

    --
    Message posted via http://www.dotnetmonster.com

    Comment

    Working...