Hi,
I have a page within which is an iframe, and within that iframs is a text area.
I need to be able to insert text into that text area from the mother page.
I have tried to insert it with the following code but it’s not working :
Any idea on how i could get this to work? The page in the iframe containts a textarea form with a field name of field_8 which the above
code is supposed to be calling, but its not working. Tested on FireFox 3
For a start, it’s click(), not Click() - JavaScript is case sensitive. Why do you want to use click()? Why can’t you just execute whatever the button would do manually?
Make sure it’s an INPUT sort of button, because click() doesn’t work on all elements. I’m not sure about BUTTON elements.
It would be useful to see either a live example or some of the relevant code for this.
Thank you so much that helped. Now the only last thing to wrap this up how would I go about automatically clicking a button after the text is inserted? I have body onLoad for inserting the text and that works fine.
I tried several things included the first long line and added .Click() no go.
You’re missing one little thing. To access the content of an iframe, you have to access its contentWindow property. So you can insert the text like so:
I guess I cant edit my previous post, I would like to be able to automatically click a button that is on the page in the iframe after the text is inserted, I have been reading a lot on Click() nothing is working out
Well for starters, my limited knowledge on JS stumps me often, and I come from PHP/Smarty land working with a codebase. I figured everything and found submitting using JS was completely pointless since I added the frame form outside of the frame and added form target=“iframe” and voila!
I’ll remember this next time I didn’t realize how easy it was but thank you so much for your help!