SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    form: label an image

    I tried doing the label tags around an img but it just won't work.

    Is this possible?

    Thanks
    Ryan
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No. <label> is for form controls only.

    What are you trying to do, exactly?
    Simon Pieters

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a form with two radio buttons. When I label the description next to each radio, the label works fine. I want to put an image in the label so, when you click on that, the radio gets selected.

    Label an image

    Ryan
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <label for="a">
      <input name="rb" id="a" type="radio" value="a">
      <img src="a.png" alt="Option A">
    </label>
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <label for="rank">
    <input name="criteria" id="rank" type="radio" value="rank" style="border:0px; margin-right:0px; padding-right:0px;">
    <img src="/images/misc/sorted-rank.gif" style="top:3px; position:relative; left:-2px;"></label> 
    <label for="list">
    <input name="criteria" id="list" type="radio" value="list" style="border:0px;"><img src="/images/misc/sorted-date.gif" width="72" height="18" style="top:3px; position:relative; left:-2px;"></label>
    Doesn't work in explorer, works in Firefox.

    Ryan
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •