samedi 9 juillet 2022

Checkbox on change event is not working on Safari

Thanks in advance for the help on this. I have a special requirement on my page where I needed a checkbox to "act" like a radio button, so only one can be checked at a time. To achieve that I used this snippet below"

<script>
$('input:checkbox').on('change', function() {
  $('input:checked').not($(this)).closest('.w-checkbox').click();
});
</script>

It works perfectly on Chrome. However, it doesn't work on Safari and allows more than one checkbox to be clicked. I was wondering if anyone had ideas on how to solve this because I have tried many alternatives and unfortunately need to have the checkbox




Aucun commentaire:

Enregistrer un commentaire