DataList with RadioButtons + Images: How to click on the images to activate the radiobutton?

Discussion in 'ASP .Net' started by Luis Esteban Valencia Muñoz, Jun 3, 2005.

  1. I have a DataList, which looks a bit like this:
    <asp:DataList id="dlstCheeseType" runat="server"
    RepeatColumns="4" RepeatDirection="Horizontal"
    ShowHeader="False" ShowFooter="False"
    ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center"
    ItemStyle-Width="25%" Width="100%">
    <ItemTemplate>
    <asp:RadioButton ID="cheeseChoice" Text='<%#
    Container.DataItem.Row("CheeseName") %>' Runat="server"
    GroupName="cheeseGroup"/>
    <br>
    <asp:Image id=imgCheese Runat="server"
    ImageUrl='<%# "Images/" & Container.DataItem.Row("CheeseImg") %>'
    Width="100px" Height="100px">
    </asp:Image>
    </ItemTemplate>
    </asp:DataList>
    (sorry for the formatting ;))

    Basically it's filled with a bunch of choices from the database, with a Name
    and a graphic. The user should be able to choose one of them using the radio
    button (that doesn't work properly, but that's a different question ;)).

    My question:
    How can I add something to allow the user to click on the images and
    activate the RadioButtons that way? (preferably something client-side, i.e.
    without posting the full form to the server)

    Thanks!
    Luis Esteban Valencia Muñoz, Jun 3, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hrvoje Vrbanc
    Replies:
    1
    Views:
    1,073
    Hrvoje Vrbanc
    Aug 27, 2003
  2. tshad

    Datalist and Radiobuttons

    tshad, Jun 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    379
    tshad
    Jun 23, 2005
  3. Hrvoje Vrbanc

    Datalist with RadioButtons question

    Hrvoje Vrbanc, Jul 28, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    511
    Hrvoje Vrbanc
    Jul 29, 2005
  4. Florian Paulus
    Replies:
    0
    Views:
    518
    Florian Paulus
    Nov 14, 2008
  5. Junkone
    Replies:
    2
    Views:
    200
    Jarmo Pertman
    Oct 27, 2010
Loading...

Share This Page