|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (5 bit)
Join Date: Mar 2002
Posts: 26
|
Radio button issue with Javascript
I'm trying to create a select all functionality with a radio button. Basically selecting one radio button would automatically select a number of other radio buttons in the form. I figured I could loop through all the radio buttons on the form and then call the values of the ones I needed to check. This doesn't seem to work. Any ideas?
function checkEmail() { with (document.choice) { for (var i=0; i < elements.length; i++) { if (elements[i].type == "radio'") if (elements[i].value == "email2" && elements[i].value == "email3") elements[i].checked = true; } } } I would call this function with an onClick in my slect all radio button. I want it to check the other radio buttons in the form with values "email2" and "email3" |
|
|
|
|
|
#2 |
|
Banned
Join Date: Jul 2000
Location: Bakersfield,CA
Posts: 7,761
|
See if anything here helps. The first it a Radio Button JS and the second is the main tutorial page.
http://www.w3schools.com/js/tryit.as...yjs_form_radio http://www.w3schools.com/default.asp |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|