There areradio buttons used in many places on the same page and set to be selected by default. As a result, when running, it was found that the radio buttons were not selected by default
Because I copied and modified individual attributes and then used them directly, the name value was forgotten to be modified. The radio button is selected based on the name.
Before modification Similar to this:
##Since radio buttons are used in multiple places, all p using radio buttons will be When displayed, the effect is similar to the following:
The code is similar to the following code (Two sets of radio buttons have the same name attribute set. The default selection is set for each group, and only the button of the last group is selected by default):
男性: <input type="radio" checked="checked" name="Sex" value="male" /> <br /> 女性: <input type="radio" name="Sex" value="female" /> <br/><br/> 男性: <input type="radio" checked="checked" name="Sex" value="male" /> <br /> 女性: <input type="radio" name="Sex" value="female" />
The above is the detailed content of The problem that the checked setting in the input attribute radio does not take effect. For more information, please follow other related articles on the PHP Chinese website!