Please help me on this. (Radio buttons)

Discussion in 'HTML & Website Design' started by magiclouie, Jun 2, 2010.

  1. #1
    [​IMG]


    I have found these sample html codes but I think these are lacking.

    <FORM ACTION="../cgi-bin/mycgi.pl">
    What size pizza?<P>

    <INPUT TYPE=RADIO NAME="pizzasize" VALUE="S">small<BR>
    <INPUT TYPE=RADIO NAME="pizzasize" VALUE="M">medium<BR>
    <INPUT TYPE=RADIO NAME="pizzasize" VALUE="L">large<P>

    <INPUT TYPE=SUBMIT VALUE="submit">
    </FORM>

    Thanks,
    Magiclouie
     
    magiclouie, Jun 2, 2010 IP
  2. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #2
    You would need PHP or you could do it with javascript.

    PHP would be,

    
    if ($_POST['go'])
    {
    $link = $_POST['link'];
    header("Location:$link");
    }
    
    PHP:
    HTML
    
    <form action='' method='post' name='field'>
    <p>
    http://www.link1.com <input type="radio" name="link" value="http://www.link1.com"/> 
    http://www.link2.com <input type="radio" name="link" value="http://www.link2.com"/> 
    http://www.link3.com <input type="radio" name="link" value="http://www.link3.com"/> 
    </p>
    <p><input type="submit" name="go" value="GO"/></p>
    </form>
    
    HTML:
    Something like that would get it done.
     
    HuggyEssex, Jun 2, 2010 IP
  3. magiclouie

    magiclouie Active Member

    Messages:
    147
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Hi HuggyEssex, thanks a lot for these. I am going to examine and study these codes.

    More power to you!
     
    magiclouie, Jun 2, 2010 IP