0

The web page I am working on requires a few html radio buttons at the bottom of a large picture. I included the id the type the name. But when I load the page, none of the radios will select.

<fieldset>
  <form id="radio" action="" method="GET">
    <input id="pic-1" type="radio" name="jumbotron-radio" value="1">
    <input id="pic-2" type="radio" name="jumbotron-radio" value="2">
    <input id="pic-3" type="radio" name="jumbotron-radio" value="3">
  </form>
</fieldset>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • Why do you not have the form wrapping the fieldset? Anyway the HTML works. Do you have an absolutely positioned element covering the radios? For example a padding of the image Try right click on one and choose INSPECT – mplungjan Jun 28 '19 at 17:46
  • No I'm pretty sure I don't have any elements that are absolutely positioned. I thought the fieldset goes around the form? It's the other way around? – Geoffrey Hutson Jun 28 '19 at 17:49
  • Yes, the fieldset goes around the fields that form the fieldset, as opposed to delineating the form. – cssyphus Jun 28 '19 at 17:50
  • @mplungjan I checked the padding of the image above the radio buttons and the padding looks fine. Not sure what it could be? – Geoffrey Hutson Jun 28 '19 at 17:59
  • Unless you explicitly set the [checked](https://www.w3schools.com/jsref/prop_radio_checked.asp) state of one of them, via just adding the `checked` attribute to the one you wish to have default selection, or via javascript to the property, that's how you'd expect to see a radio group by default. – Chris W. Jun 28 '19 at 18:15
  • Possible duplicate of [Assign an initial value to radio button as checked](https://stackoverflow.com/questions/4711036/assign-an-initial-value-to-radio-button-as-checked) – Chris W. Jun 28 '19 at 18:21

0 Answers0