Radio Buttons in Javascript

Hi,

Does anyone know how to get a radio button working in javascript/vue?

I’m trying a yes/no button.

I’ve got a check on it to make sure it starts with the correct yes/no for going back and forwards by setting up as checked or not ("v-if=“data_privacy”).

Once setup I can move to Yes or No but the No constantly stays checked.

I’ve been trying to set the value of consentYes and consentNo to 1 and 0 or true and false but neither gets the No button working.

<div v-if=“data_privacy” class=“radio_choices-row”>
<label class=“custom-control custom-radio”>
<input v-on:click=“consent_yes” :name=“mats.input_name + ‘[consentYes]’” class=“required col-form-value valid_choice custom-control-input” type=“radio” :value=“consentYes” checked=“checked” >
<span class=“custom-control-indicator”>
<span class=“custom-control-description”>Yes
</label>
</div>
<div v-if="!data_privacy" class=“radio_choices-row”>
<label class=“custom-control custom-radio”>
<input v-on:click=“consent_yes” :name=“mats.input_name + ‘[consentYes]’” class=“required col-form-value valid_choice custom-control-input” type=“radio” :value=“consentYes”>
<span class=“custom-control-indicator”>
<span class=“custom-control-description”>Yes
</label>
</div>
<div v-if=“data_privacy” class=“radio_choices-row”>
<label class=“custom-control custom-radio”>
<input v-on:click=“consent_no” :name=“mats.input_name + ‘[consentNo]’” class=“required col-form-value valid_choice custom-control-input” type=“radio” :value=“consentNo”>
<span class=“custom-control-indicator”>
<span class=“custom-control-description”>No
</label>
</div>
<div v-if="!data_privacy" class=“radio_choices-row”>
<label class=“custom-control custom-radio”>
<input v-on:click=“consent_no” :name=“mats.input_name + ‘[consentNo]’” class=“required col-form-value valid_choice custom-control-input” type=“radio” :value=“consentNo” checked=“checked” >
<span class=“custom-control-indicator”>
<span class=“custom-control-description”>No
</label>
</div>

I’ve tried other ways like having the :name all the same (mats.input_name + ‘[consent]’) and the :value as yes or no and this instead means then setting this.consent to yes or no then you have to press No twice for it to move over but yes works fine.

Has anyone got a working example preferably one where you can set it to yes or no before entering the page?

Thanks
Robin