Perfect!!! Thank you. Respectfully,
J. Russell Keith Employee Systems Analyst American Airlines Federal Credit Union 817.931.4459 Direct 800.483.0944 Fax [email protected] -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of willwill Sent: Monday, February 08, 2010 4:12 PM To: Prototype & script.aculo.us Subject: [Proto-Scripty] Re: Focus on element in iFrame. Yes there is, and you can find out more here: http://www.dyn-web.com/tutorials/iframes/ I recently had a similar problem and something like $('generateId').contentWindow.$('type').focus(); should work. Just be sure that you have Prototype loaded in both the parent and the child frame, since they are different execution contexts. The magic reference is to contentWindow of the iFrame. More about that in the above tutorial. As far as I know this works in the latest Firefox, Safari, Chrome and probably IE8. No guarantees for earlier browsers. Cheers, William On Feb 8, 3:58 pm, "Russell Keith" <[email protected]> wrote: > I have an iframe on a page with an ID of 'generateID'. There is a field > on the page loaded in the iframe with and ID of 'type'. I want the > 'type' field to have focus when I make the iframe visible. I want to do > it from the parent window. I have tried the code below. Is there a way > to make this work? > > $('generateID').show(); > > $('generateId').type.focus(); > > $('generateID').show(); > > $('generateId').$('type').focus(); -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
