but it doesn't work.<span style="cursor:pointer;" onclick="_parent.newpost.article_contentimage.value ='testing';"><img src="files/images/layout/delete.png" width="16" height="16" border="0" /> Remove Image</span> ]
Change the value of a textfield located on the parent page?
Moderator: General Moderators
Change the value of a textfield located on the parent page?
I have a link in an iframe. When I click on it, I want it to write a value on a textfield called article_contentimage which is not located in the iframe but in the page holding that iframe. I tried,
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Change the value of a textfield located on the parent page?
I haven't worked with iframes though it you are using JavaScript with two levels of frames you'll need to use _parent._parent..
Have you tried object detection to see if JavaScript can alert whether or not it sees the object you're trying to work with? I always alert things to see if they exist first...once they do then I write the corresponding JavaScript.
Have you tried object detection to see if JavaScript can alert whether or not it sees the object you're trying to work with? I always alert things to see if they exist first...once they do then I write the corresponding JavaScript.
Re: Change the value of a textfield located on the parent page?
Ah, I used parent.document.newpost.article_contentimage.value instead of _parent.newpost.article_contentimage.value and it works.