#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    6
    Rep Power
    0

    Image Radio Buttons - JavaScript


    Im trying to get this code to work for radio buttons http://www.brainerror.net/scripts_js_checkbox2.php but cant seem to get it going. I have it working for checkboxes fine and have tried switching

    if(inputs[i].getAttribute('type') == 'checkbox') {

    to

    if(inputs[i].getAttribute('type') == 'radio') {

    which works but causes the radio buttons to not act like radio buttons. In other words a user is able to select more than one radio button per answer set which shouldnt be so.

    Can anyone help with this thanks.
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4309
    It's not that simple. Changing one word can not change the behavior of a working script that much.

    Check this out: http://www.codeproject.com/jscript/wdxinputreplacer.asp
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    6
    Rep Power
    0
    Originally Posted by Kravvitz
    It's not that simple. Changing one word can not change the behavior of a working script that much.

    Check this out: http://www.codeproject.com/jscript/wdxinputreplacer.asp
    Now thats what im talking about. Thanks a mil.

IMN logo majestic logo threadwatch logo seochat tools logo