CoderZone.org

Category: >> JavaScript >> Check radio button selection Bookmark and Share

<< lastnext >>

Snippet Name: Check radio button selection

Description: Make sure a radio button is selected.

Comment: (none)

Author: CoderZone
Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: February 27th, 2009

    var radios = document.forms.myform.elements.mychkboxes;
    for(var i=0; i<radios.length; i++){
        if(radios[i].checked) return true;
    }
    alert('Please select a category for this game.');
    return false;
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 10