Firefox and radio buttons

The code below works in IE 7.0 but not Firefox 3.0.6.  Firefox error console says "Warning: Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead." and "Error: plyrs[0] is undefined".

I tried q=getElementById("plyers") but q doesn't seem to contain the needed info.  How do I determine which radio button is checked in FF?
<script>function aj(a,b,c){}</script>
<table>
<tr>
<td style='font-family: arial,helvetica,verdana,lucida,sans-serif; font-size: 10pt;'>
<input type='radio' value='1' id='plyrs' name='plyrs' checked>Choose from pitchers on specific team(s).
</td>
<td rowspan=2>
<input type='button' value='Go' onclick='javascript:aj(false,4,plyrs[0].checked)'>
</td>
</tr>
<tr>
<td style='font-family: arial,helvetica,verdana,lucida,sans-serif; font-size: 10pt;'>
<input type='radio' value='2' name='plyrs'>Choose from pitchers in the league.
</td>
</tr>
</table>

Open in new window

Bob3975Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

erikTsomikSystem Architect, CF programmer Commented:
can you post more code

0
Bob3975Author Commented:
There really is no more relevant code as the code posted will produce the error.  Just copy and save the code to a file and open with FF.
0
alien109Commented:
try this:
<input type='button' value='Go' onclick='javascript:aj(false,4,document.getElementById("plyrs").checked)'>
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Bob3975Author Commented:
I believe getElementById("plyrs").checked does not differentiate between the two buttons.  As far as I can tell neither does getElementById("plyrs").value.
0
alien109Commented:
the first radio has an id set, the other doesn't, so yes it will differentiate between the two.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob3975Author Commented:
Yes, it requires a unique id for each radio button and works in both browsers.  IE would access as an array.
0
Bob3975Author Commented:
The solution requires a unique id for each radio button and works in IE and FF.  IE could access as an array (id[0]) when both id's were the same.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.