Jacascript assistance..

Discussion in 'General Programming Chat' started by Gitnmesumcash, Aug 13, 2009.

  1. Gitnmesumcash

    Gitnmesumcash Junior Member

    Joined:
    Apr 28, 2009
    Messages:
    143
    Likes Received:
    38
    Hey guys...

    I'm seeking some assistance with a simple greasemonkey script.
    This isn't all of the script but just the portion I believe I need modified. The last part of the script "if (radios>2)" it obviously detects greater then 2 radio buttons and selects the 2nd radio as a YES.

    What I need is when it finds greater than 2 radials, I need it to select not just one but 3 or 4 YES radio leaving the rest as NO like it does.

    Any help will be greatly appreciated. Thanks!

    if(inputs.type=="radio")
    {
    if(!foundradio)
    {
    firstradio = i;
    foundradio = true;
    }
    radios++;
    if(inputs.value.toLowerCase()=="no")
    {
    inputs.checked = true;
    inputs.click();
    document.body.focus();
    }
    else
    {
    inputs.checked=true;
    }
    }

    }
    if (radios>2)
    {
    inputs[firstradio+2].checked=true;

    }