Radio default checked doesn't works

I have a form with two radio groups. I would need, for one of them, that one of the options was selected by default. Of course I entered 'checked' but it doesn’t work.

<div is="dmx-radio-group" id="group2" class="radio-group" align="center">


                       <font color="#000000" size="+1"><b>SI</b></font>
                        <input type="radio" id="radio3" name="radios2" value="1" checked>







                        <font color="#000000" size="+1"><b>NO</b></font>
                        <input type="radio" id="radio4" name="radios2" value="0">



                    </div>

What could be the cause of the problem?
To solve temporarily, I added:

<script>
        window.onload = function() {
    document.getElementById("radio3").checked = true;  
  };
    </script>

Your code works fine to me..
(no script needed...)

Whichever input has the checked it is selected

Maybe haven't saved your page???

Yes I saved it... in 'Design Mode' of Wappler I see it selected. but then when I preview in the browser I do not see it selected anymore

Design mode:

Browser:

(now without use the script)

I'm talking about browser also...
I'm on chrome.

Check your browser dev... You see your inputs normally on Elements tab?
Do you get any errors or wornings? Anything weird?

You’re using a radio group component. Set its value to the value of the radio which you want to be checked, or just don’t use the radio group component.

2 Likes