Javascript Can';无法在window.document.forms[0]中找到元素

Javascript Can';无法在window.document.forms[0]中找到元素,javascript,Javascript,我有一个页面,它有单选按钮,选择的值是在一个函数中获取的,比如 function returnSelect() { window.document.forms[0].choice_processType.value ; window.opener.document.forms[0].pevent.value = 'getpNames'; window.opener.document.forms[0].processName.value=''; for (var

我有一个页面,它有单选按钮,选择的值是在一个函数中获取的,比如

function returnSelect()
{
     window.document.forms[0].choice_processType.value ;
    window.opener.document.forms[0].pevent.value = 'getpNames';
    window.opener.document.forms[0].processName.value='';
    for (var i=0; i < document.forms[0].elements.length; i++)
   {
   if (document.forms[0].elements[i].checked)
      {
      window.opener.document.forms[0].processName.value=document.forms[0].elements[i].value;
      break;
      }
   }
   if(window.opener.document.forms[0].processName.value=='')    {
        window.opener.document.forms[0].pevent.value = '';
   }
    window.opener.document.forms[0].submit();
    closeConn();
}
函数returnSelect()
{
window.document.forms[0]。选择_processType.value;
window.opener.document.forms[0].pevent.value='getpNames';
window.opener.document.forms[0].processName.value='';
对于(var i=0;i
因此,在这里,当我使用Firebug时,window.document.forms[0]既没有processName也没有pevent等(它是null)


如何调试此问题?

使用parent.wndow.document它可以工作

这与Firebug有什么关系?这个问题与
window.document.forms[0]
有关;在没有看到合适的测试用例的情况下,很难说使用
document.forms
是非常不可取的(做一些类似于通过ID获取元素的事情)。我对使用firebug调试这个问题很感兴趣,这段代码是我们公司的,并且已经存在很长时间了。现在它不起作用了,我需要调试,所以我只想在firebug中调试这个问题。你可能对这个问题感兴趣:而且我很确定,通过名称访问表单元素在FF7或8上被破坏了,但在FF10中看不到这种行为。