1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Code for radio button

Discussion in 'Web Design, HTML And CSS' started by newphpcoder, Dec 9, 2010.

  1. newphpcoder

    newphpcoder New Member

    Joined:
    Sep 24, 2010
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Web Programmer
    Location:
    Philippines
    Good day!
    I never used radio button. Now I need to add radio button in my webpage. Radio button 1 is mother and radio button 2 is child. Is it in my database it is only 1 field or separate field one for mother and one for child?
    Kindly give me a code for radio button.
    Thank you...
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    PHP does not have a Radio button and it is in HTML and so moved your thread to HTML forum

    Use the following code

    Code:
    <INPUT TYPE="radio" NAME="">
     
  3. kumarpyasa

    kumarpyasa Banned

    Joined:
    Nov 19, 2010
    Messages:
    10
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    seo
    Location:
    In Delhi
    Home Page:
    Hello dear
    code for radio button
    <input type="radio" name=""><p>

    <input type="radio" name="">
     
    Last edited: Mar 22, 2011
  4. pyasakumar

    pyasakumar New Member

    Joined:
    Apr 12, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Seo
    Location:
    Delhi
    Home Page:
    Hello dear
    Code for Radio Button
    <input type="radio" name="male">
    <input type="radio" name="Female">
     
  5. mialuzzatto

    mialuzzatto New Member

    Joined:
    Aug 5, 2015
    Messages:
    122
    Likes Received:
    4
    Trophy Points:
    0
    Occupation:
    Work at https://www.idevelopersquare.com
    Location:
    Waltham, MA, USA
    Home Page:
    Hello,

    Please check code....


    <!DOCTYPE html>
    <html>
    <body>

    <form action="">
    <input type="radio" name="sex" value="male">Male<br>
    <input type="radio" name="sex" value="female">Female
    </form>

    <p><b>Note:</b> When a user clicks on a radio-button, it becomes checked, and all other radio-buttons with equal name become unchecked.</p>

    </body>
    </html>

    ---
    Regards,
    Mia Luzzatto
     
  6. alia123

    alia123 New Member

    Joined:
    Jan 8, 2016
    Messages:
    65
    Likes Received:
    3
    Trophy Points:
    0
    Hey,I am sharing a link,try this:
    HTML:
    <!DOCTYPE HTML>
    <html lang = "en">
      <head>
        <title>formDemo.html</title>
        <meta charset = "UTF-8" />
      </head>
      <body>
        <h1>Form Demo</h1>
        <form>
          <fieldset>
           <legend>Selecting elements</legend>
           <p>
              <label>Radio buttons</label>            
              <input type = "radio"
                     name = "radSize"
                     id = "sizeSmall"
                     value = "small"
                     checked = "checked" />
              <label for = "sizeSmall">small</label>
              
              <input type = "radio"
                     name = "radSize"
                     id = "sizeMed"
                     value = "medium" />
              <label for = "sizeMed">medium</label>
     
              <input type = "radio"
                     name = "radSize"
                     id = "sizeLarge"
                     value = "large" />
              <label for = "sizeLarge">large</label>
            </p>       
          </fieldset>     
        </form>
      </body>
    </html>
     

Share This Page