Answers for "add required field in html on radio button"

4

radio button required

One input with required attribute is enough.

<form>
  Select Gender:

  <label><input type="radio" name="gender" value="male" required>Male</label>

  <label><input type="radio" name="gender" value="female">Female</label>

  <label><input type="radio" name="gender" value="other">Other</label>

  <input type="submit">
</form>
Posted by: Guest on April-16-2020

Code answers related to "add required field in html on radio button"

Browse Popular Code Answers by Language