tobeyt23 Posted September 21, 2007 Share Posted September 21, 2007 Need help checking that either radio id=1 or id=2 or id=3 is checked. Each radio id may contain more than 1 option. Any ideas on how to does this? Quote Link to comment Share on other sites More sharing options...
tobeyt23 Posted September 21, 2007 Author Share Posted September 21, 2007 I did this and it seems to work, does anyone see something wrong with it? function radioEducationHasValue() { var found = false; els = document.getElementsByName('hs_grade'); for(j=0;test = els[j];j++) { if( test.checked ) { found = true; } } els = document.getElementsByName('c_grade'); for(j=0;test = els[j];j++) { if( test.checked ) { found = true; } } els = document.getElementsByName('post_grad'); for(j=0;test = els[j];j++) { if( test.checked ) { found = true; } } if( !found ) { alert('Highest level compeleted must have one selected'); return false; } return true; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.