dhvcc

Checkbox that resets/blocks other value

Dec 18th, 2020
211
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('input:checkbox[value="none"]').click(function(event) {
  2.   let name = event.target.name;
  3.   let inputs = $(`input[name=${name}][value!="none"]`);
  4.   if (event.target.checked) {
  5.     inputs.prop('checked', false);
  6.     inputs.prop('disabled', true);
  7.   } else {
  8.     inputs.prop('disabled', false);
  9.   }
  10. });
RAW Paste Data