+ 2
How to lock an option (form attributes)
Hello guys, currently i am learning about forms in HTML. When i tried to code this way: <form> <input type="radio" gender="name" value="male"/> Male <br /> <input type="radio" gender="name" value="female"/> Female <br /> </form> I found out that both options can be checked -- Male & Female. Is there a way to prevent that? So we can chose only either Male or Female. Thank you.
3 Antworten
+ 3
You reversed part of it.
that otta be:
name="gender"
And the rest is correct.
+ 2
<input type="radio" name="gender" value="male" />Male <br />
<input type="radio" name="gender" value="female" />Female <br />
0
Ah, i got it. Wrong attributes. Thank you.