Salis Posted June 29, 2007 Share Posted June 29, 2007 Ok, I'm building an editor for my site. Nothing super great. I have an IFRAME and in the IFRAME is image list and uploader. What I need help on is sending a string from the IFRAME to the parent window. The idea is to upload files though the frame and also list them in a drop down <select> box. So if I wanted to add an image, I'd go to the IFRAME, browse for my image, click upload the choose my image from the list and click add. After I click Add I need that <a> link to be sent to the textarea on the main parent page? How would I do that? Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted June 29, 2007 Share Posted June 29, 2007 Hi this might help you the main page <script type="text/javascript"> //funtion that sets the value in the showString Div function showString(iframeVar){ document.getElementById('showString').innerHTML=iframeVar; } </script> <div id="showString"></div> <iframe src="iframe.html"></iframe> iframe page function transferString(){ var myIframeVar="this was send from the Iframe" window.parent.showString(myIframeVar); } <button onclick="transferString()"> transfer string <button> Quote Link to comment Share on other sites More sharing options...
Salis Posted June 29, 2007 Author Share Posted June 29, 2007 Perfect! just what I needed. Thanks Dj Kat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.