Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing embedded page

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
US
I am using XHTML strict so the code for embedded page is like that:
Code:
  <object id="ta1" data="ta.aspx?b=1&s=1" type="text/html">
  </object>

I am trying to make the embedded page postback from the parent page. The js code works in firefox but not in IE (IE7, more specifically).

Here is the code in the parent page.

Code:
function test()
{
	var frm;
	if (navigator.appName == 'Microsoft Internet Explorer')
	{
  	frm=document.getElementById("ta1").document.forms['form1'];
  	frm.__EVENTTARGET.value = 'NeedTA_Desc';
    frm.__EVENTARGUMENT.value = '';
    frm.submit();
  }
  else
  {
    frm=document.getElementById("ta1").contentDocument.getElementById("form1");
   	frm.__EVENTTARGET.value ='NeedTA_Desc';
    frm.__EVENTARGUMENT.value = '';
    frm.submit(); 	
  }
}

I found out that the code
frm=document.getElementById("ta1").document.forms['form1']
gave me a null object.

So how do I get the form object in IE?

Thanks in advance.

Seaport
 
Dan,

I agree with you. I have the code to access iframe as below. However, xhtml strict does not allow iframe. Using iframe will be my last solution. I might use js to insert iframe to the page so my page will still be xhtml strict.

Code:
document.frames("ta1").document.getElementById("form1")

seaport
 
hi,

I just figured it out.

The code should be:
Code:
document.getElementById("ta1").getElementById('form1');

seaport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top