Originally posted by Bruce - PhosphorMedia
View Post
I forgot to post what I ended up using in case someone else needs it.
HTML Code:
<script> document.addEventListener("DOMContentLoaded", function () { function checkRadioButtonByValue(value) { const radioButtons = document.getElementsByName("mmx_contactform:fields[1]"); for (const radio of radioButtons) { if (radio.value === value) { radio.checked = true; break; } } } // Automatically select the desired radio button when the page loads checkRadioButtonByValue("Text label here for the option to be selected"); }); </script>
Leave a comment: