Forum
Radio button - set one selected as default
I have a radiobutton input like this:
<perch:content id="content_alignment" type="radio" label="Align image" options="Left, Right, Center">
Can I set one of the options as selected by default?
I have a radiobutton input like this:
<perch:content id="content_alignment" type="radio" label="Align image" options="Left, Right, Center">
Can I set one of the options as selected by default?
Hi Tim,
I think you should be able to add
To set the default to
Left
Thanks, I will try that!
hello, I have an HTML form like
I can get the selected value in Chrome by form/input name with the following javascript
document.forms['radio-mc']['mc'].value But in Firefox, the value is undefined.
I would normally think this was a specialty of Chrome but in the Firefox inspector I can see that parent object is an [object NodeList] that has a value property. It's simply not set to anything... seemingly ever.
I cannot use jQuery in this situation. Is there any way to get that one value in vanilla javascript in Firefox (without iterating over the radio buttons like I can in Chrome)?