How to do this..

Discussion in 'HTML & Website Design' started by kevin7654, Nov 9, 2006.

  1. #1
    How can I make an html form that is 4 pictures, each one has a radio button below it, and I want to be able to click on the picture and select the corresponding radio button.

    Thanks,
    Kevin
     
    kevin7654, Nov 9, 2006 IP
  2. deep034

    deep034 Peon

    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    its possible using javascript, i dont think u can do it with just html/css
     
    deep034, Nov 9, 2006 IP
  3. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #3
    You can ;)

    
    <label for="element_id1"><img alt="" src="image1.jpg" /></label><br />
    <input type="radio" name="something" value="value1" id="element_id1" /><br />
    
    <label for="element_id2"><img alt="" src="image2.jpg" /></label><br />
    <input type="radio" name="something" value="value2" id="element_id2" /><br />
    
    <label for="element_id3"><img alt="" src="image3.jpg" /></label><br />
    <input type="radio" name="something" value="value3" id="element_id3" /><br />
    
    <label for="element_id4"><img alt="" src="image4.jpg" /></label><br />
    <input type="radio" name="something" value="value4" id="element_id4" /><br />
    
    HTML:
     
    SoKickIt, Nov 10, 2006 IP
  4. kevin7654

    kevin7654 Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    does it have to be html4.0 strict or can it be XHTML 1.0 Transitional?
     
    kevin7654, Nov 10, 2006 IP
  5. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #5
    My example is XHTML but you can do the same thing in HTML.
     
    SoKickIt, Nov 10, 2006 IP
    -Abhishek- likes this.
  6. kevin7654

    kevin7654 Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks for the help, sorry about my quesiton about the html/xhtml, I just had an error in my code
     
    kevin7654, Nov 10, 2006 IP
  7. nirghum

    nirghum Banned

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thanks that was an wonderfull solutiion.
    as im a html learner. i would try this out. and that is a nice tool in my bag.
     
    nirghum, Nov 10, 2006 IP
  8. YooChoob

    YooChoob Peon

    Messages:
    118
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    dreamweaver has a function built inn to allow for this i believe less ,abour intensive
     
    YooChoob, Nov 11, 2006 IP
  9. deep034

    deep034 Peon

    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    i think dreamweaver does too
     
    deep034, Nov 15, 2006 IP