Code for radio button

newphpcoder's Avatar, Join Date: Sep 2010
Ambitious contributor
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...
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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="">
0
kumarpyasa's Avatar
Banned
Hello dear
code for radio button
<input type="radio" name=""><p>

<input type="radio" name="">

Last edited by kumarpyasa; 22Mar2011 at 15:47..
0
pyasakumar's Avatar, Join Date: Apr 2011
Newbie Member
Hello dear
Code for Radio Button
<input type="radio" name="male">
<input type="radio" name="Female">
0
mialuzzatto's Avatar, Join Date: Aug 2015
Ambitious contributor
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
0
alia123's Avatar, Join Date: Jan 2016
Go4Expert Member
Hey,I am sharing a link,try this:
HTML Code:
<!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>