Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    MKO
    MKO is offline
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Radio button reference

    Hi

    Ok, so I have only 1 radio button on my page & I want to reference it for a message but I cant get it to work. What is wrong with this reference?

    Code:
    if(document.formName.radioName[0].checked == true)
    I have no problems looping through more than one, but cant this to work for a single button. Why??

    Thanks

    M

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Can you show us your form elements too? It doesn't make sense to me at first glance, should work with just one button.

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    I just played around a bit with a single radio button and sure enough the array does not exist, but the single radio non-array object can be referred to, i.e. if(document.form1.radioBtn.checked) {}


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •