0

I have a page which has radio buttons and the selected value is taken inside a function like

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();
}

So here when I use Firebug, window.document.forms[0] does not have either processName or pevent etc. (it is null)

How do I debug this issue?

Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
siva
  • 1,105
  • 4
  • 19
  • 38
  • What has this to do with Firebug? The issue is to do with `window.document.forms[0]`; without seeing a proper test case, it's difficult to help beyond saying that using `document.forms` is strongly inadvisable (do something like fetching the element by ID instead). – Chris Morgan Mar 07 '12 at 05:54
  • I am interested in debugging this issue using firebug and this code is our company's and is there for a long time. Now its not working and I need to debug – siva Mar 07 '12 at 06:05
  • So I just want to debug this issue in firebug Appreciate ur inputs on resolving the same – siva Mar 07 '12 at 06:06
  • You may be interested in this: http://stackoverflow.com/a/6504878/255363 Also I'm pretty sure, accessing form elements via name was broken on FF 7 or 8, but couldn't see such behaviour in FF10. – kirilloid Mar 07 '12 at 06:35

1 Answers1

0

using parent.wndow.document it works

siva
  • 1,105
  • 4
  • 19
  • 38