elsewhere home of a .NET geek

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 1 Stories | 52 Comments | 35 Trackbacks

News

This blog has random information about Managed Code and Design Pattern. Every day, while i code, the thoughts come in mind are the one you would be reading here.

If you're seeking me for asking any questions, please use the contact page of this site.

Twitter












Article Categories

Archives

Post Categories

I was facing an strange error (Grrrrr!! I can't say it is an error!!) while testing an page with IE and FF. The deal is i have an IFRAME sitting a Page and i have to read the values of the textboxes present in the IFRAME from the page. The following code worked fine in IE but not in FF

        var _email  = document.frames[0].document.getElementById('emailAddress');

I got pissed off for a while to identify the proper code, the solution is as below which worked in both IE and FF,

var iFrame = parent.frames[0]; //Get the IFRAME         

var
_email = iFrame.document.forms[0].elements['emailAddress'];
// then, locate the textbox using the 'element' object

Let me see, if any body can post more better script :)

posted on Monday, April 10, 2006 5:38 AM