+ 5
How to make form of radio type in which only one input is selectable..?
I made html in which i cant fix radio type form Focus on gender option on running it, all options of gender, can be selectd and once you select it you cant unselecet it but i dont want it. I wanted to make it only one selectable.. And can be unselected if any one has to change option.. [ <form> <div>E-mail<br> <input type="email" name="email" placeholder="abc@gmail.com"><br> Password<br> <input type="password" name="password" placeholder="*****"><br> Re-enter password<br> <input type="password" name="password" placeholder="*****"><br></div> <br><div><b>Gender</b><br> <input type="radio">Male <br> <input type="radio">Female <br> <input type="radio">Other<br></div> </form> ] (https://code.sololearn.com/WwvxBNKwsLq8/?ref=app)
6 Answers
+ 5
Give them the same name.
<br><div><b>Gender</b><br>
<input type="radio" name="gender">Male <br>
<input type="radio" name="gender">Female <br>
<input type="radio" name="gender">Other<br></div>
+ 5
Thanx bro. It works
+ 4
No it didn't works
+ 4
You have to give same name
I find it from above ans
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<form id="form" method="get" onsubmit="return v()">
<input type="radio" name="gender">male
<input type="radio" name="gender">female<br/>
<span id="mess"> </span><br/>
<input type="submit">
</form>
</body>
</html>
+ 3
May it helps