Jorge Solá 9/1/2025 7:41:52 AM Thank you. Your script didn't work for me, maybe because I'm using it in a web-to-record form. But with ChatGPT's help I was able to add a much more complex script that is working for me. Here it is:
<script> (function () { const GROUP = 'f_xxxxxxxx'; // your radio group name
function clearRadios() { const radios = document.querySelectorAll(`input[type="radio"][name="${GROUP}"]`); radios.forEach(r => { if (r.checked || r.hasAttribute('checked')) { r.checked = false; // clear runtime state r.removeAttribute('checked'); // clear HTML attribute (default) } }); // (Optional) force the group to be required without preselecting // if (radios.length) radios[0].setAttribute('required', 'required'); }
function init() { clearRadios(); // In case TeamDesk sets it a moment later, clear again a few times setTimeout(clearRadios, 0); setTimeout(clearRadios, 250); setTimeout(clearRadios, 800);
// Keep it clear if the checklist re-renders/updates dynamically const target = document.querySelector('ul.fs-checklist.v3-checklist') || document.body; const mo = new MutationObserver(clearRadios); mo.observe(target, { childList: true, subtree: true }); }
if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })(); </script>
|