Ensure only one checkbox is selected in the cloud page?

cloudpagehtmlmarketing-cloud

I was not sure that you can only select one radio button. Currently both responses are being collected. enter image description here

Any help appreciated.

 <div class="sc-formfield-input"><label>&nbsp;<!-- Just Blank--></label>
   <label class="Checkbox">
   <input type="radio" name="No" data-field-type="Boolean">&nbsp;Will Not Attend 
     <input type="radio" name="Yes" data-field-type="Boolean">&nbsp;Will Attend
   </label>

Best Answer

The "name" must be the same for both input fields; this is what links radio buttons together. Use the "value" to specify the value that should be used.

<div class="sc-formfield-input"><label>&nbsp;<!-- Just Blank--></label>
    <input type="radio" id="willNotAttend" name="attendance" value="No" data-field-type="Boolean">
    <label for="willNotAttend">Will Not Attend</label>
    <input type="radio" id="willAttend" name="attendance" value="Yes" data-field-type="Boolean">
    <label for="willAttend">Will Attend</label>
</div>

You can read more about this behavior in <input type="radio">.

Related Topic