JavaScript Category

Check the status of radio buttons with javascript

Thursday, January 29th, 2009 at 00:25:02
0

Here is a way to check whether or not a radio button from a group was selected. Here is the javascript function:

function checkRadioSelected(oRadio) {
    var bChecked = false;
    for (var i=0;i<oRadio.length;i++) {
        if (oRadio[i].checked) {
            bChecked = true;
        }
    }
    return bChecked;
}