| Author |
Accessing iframe elements in javascript
|
Manohar Saddala
Greenhorn
Joined: Jul 11, 2007
Posts: 12
|
|
Hi All, I have an html page which consists of iframe. In the iframe i had defined a form with two input elements and one button element.when i click the button in will be calling a javascript. what my problem is in the javascript i am unable to get the input elements values defined in the form and i am unable to perform the form related functions like form.action(), form.submit().. etc.. Please help me regarding the issue.. Regards, manohar
|
manu
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Talk to the iframe from the parent: document.getElementById("iframeId").formName.elementName.value = "foo"; Talk to the parent from the iframe parent.formName.elementName.value = "bar"; Eric
|
 |
Manohar Saddala
Greenhorn
Joined: Jul 11, 2007
Posts: 12
|
|
hi, i had tried the way you had said but iam getting the error like is null or not an object. my page was designed like below: in the body tag i have an button which calls a javascript funtion i have a iframe which has a form as a member to the iframe.I the form i had an text box. what i want to do is when i click on the button in the javascript i need to validate the value in the textbox and then i want to submit the form to server side. Regards, manohar
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Accessing iframe elements in javascript
|
|
|