Javascript not working in Firefox

Thank you for taking time to read this, I am using javascript to change the value of a radio button. The code below works fine in IE but not in firefox. I was wondering if anyone could please tell me why?

document.forms[0].HidStatusOrig[6].checked = true;

document.forms[0].IsNewDoc.value =“4”;

Subject: Javascript not working in Firefox

Matthew, here are some ideas to try to help debug,

alert(document.forms[0]);

//if this alert does not work, you probably have bad html somewhere on the page

alert(document.forms[0].HidStatusOrig);

//if this alert does not work, you may have misspelled the field name (or have the wrong upper/lowercase?), or the field is not properly displaying on the page, or the field is named something else but has “HidStatusOrig” as the id?

alert(document.forms[0].HidStatusOrig.length>=6);

//if this alerts false, then there might not be enough choices in the radio button field

alert(document.forms[0].HidStatusOrig[6][‘checked’]);

//if this does not alert “true” or “false”, then you might have some other HTML or javascript element causing interference by having “HidStatusOrig” as an ID or the name of a variable

Subject: RE: Javascript not working in Firefox

Looks like I found the issue, turns out IE will still work with a hidden field but Firefox will not.

Subject: Javascript not working in Firefox

In what way does it fail to work? Do you get an error? If so, try to use alerts to determine which of the objects in the container hierarchy are null.

alert(typeof(document));

alert(typeof(document.forms));

alert(typeof(document.forms[0]));

etc.

You will probably find one of them is undefined.

Subject: RE: Javascript not working in Firefox

Looks like its having an issue with my first line, do you know why that line would work in IE and not in Firefox

document.forms[0].HidStatusOrig[6].checked = true;

Subject: RE: Javascript not working in Firefox

you probably need to use the full hierarchy starting from window.document.forms[… etc.