Stop multiple radio buttons being selected
The outside and inside radio buttons need to have the same name:
<input type="radio" id="nosupp" name="supp" onchange="resetSupp(this);" value="NoSupplier">
<input type="radio" id="chk1" name="supp" onchange="change(this);" value="ADD VARIABLE SUPPLIER TYPE HERE">
Also, id
attributes need to be unique. No two HTML Elements should have the same id attribute value, so using the same id
in a loop won't do what you expect.
The name
attribute of the HTML radio button groups them. Using the same name
, but a different id
, will let you find them uniquely but still group them together. By grouping them, you can make sure that only one button from a given group is checked.