Link to home
Start Free TrialLog in
Avatar of fpoyavo
fpoyavoFlag for United States of America

asked on

run function

Hi Experts,

I have JSP page within IFRAME and need to execute Javascript located in main page when some key is pressed. How ?

Thank you.
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

With my limited knowledge of javascript.. its seems that its not possible...

is it a inline function or its a function thats written in a .js file and js file is included??
Avatar of fpoyavo

ASKER

The problem is that this is function using elements of the main page. May be You know how to access elements of the main page from IFRAME ?

Thank you.
oh yeah thats easy...:-)

parent.document.getElementByid("elementName");

or
ParentFrameName.document.getElemenetById(""elementName");
Avatar of fpoyavo

ASKER

almost correct.. should be top.document.getElementById('elementName').value.
ASKER CERTIFIED SOLUTION
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial