TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
Radio Buttons with "None" selected at first creation
At the moment, a Text field with Radio Button choices has the first choice pre-selected.
I'd like to see that ALL radio buttons are de-selected upon creating a record.
ID
896
Category
User Experience
Author

basenine
Date Created
8/25/2015 7:22:44 AM
Date Updated
9/1/2025 8:44:06 AM
Status
New Idea
Score
70
Promoted By
Jorge Solámartin oliverScott Miller
Dale OliverPhilipp Matuschka (MMB)Gii Systems
basenine
Comments
Philipp Matuschka (MMB) 8/25/2015 3:19:08 PM
Totally agree. In fact I think you'll find that it only looks like the first one is selected and that if you press save the field will have no entry. I haven't checked that again today but seem to remember it from the last time I was dealing with it. That is even more confusing, so your suggestion is a good one.
Jorge Solá 8/31/2025 4:47:38 PM
If there is no default value, no radio button should be pre-selected. Otherwise users are tricked into thinking that the first choice is already selected. To avoid giving this false impression, sometimes I've resorted to having the first choice as the default value. But in certain situations you don't want to have a default value.
For instance, a Sex column with Male/Female as the options. You don't want to have Male as the default value, but neither do you want to have no default value & show Male as if it was pre-selected, because male users will not bother to check that radio button.
basenine 8/31/2025 5:43:59 PM
try adding this to the top of your record in a form text field, set to HTML, Replace "f_xxxxxxxx" with your column value:

<script>
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('input[name="f_xxxxxxxx"]').forEach(radio => {
radio.checked = false;
});
});
</script>
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>
basenine 9/1/2025 8:44:06 AM
😎👍
Feedback
 
Back to Search Results