I used radio button for language selection.
When I click English the radio button of English should be disabled. Again I should not able to click the English radio button till I click the next language it should be in disabled position. In Java code I need.I created the xml file.
A disabled Radio Button is un-clickable and unusable. It is a boolean attribute and used to reflect the HTML Disabled attribute. It is usually rendered in grey color by default in all the Browsers.
Using Input Radio checked property: The Input Radio checked property is used to return the checked status of an Input Radio Button. Use document. getElementById('id'). checked method to check whether the element with selected id is check or not.
To enable and Disabled Radio Group write this code.
// To disabled the Radio Buttons of radio group.
for (int i = 0; i < radioUser.getChildCount(); i++) {
radioUser.getChildAt(i).setEnabled(false);
}
where radioUser=RadioGroup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With