pankaj.ghadge Posted September 10, 2008 Share Posted September 10, 2008 suppose i have main page. In that main page i have included a iframe. In that iframe i have created a form.how come my main page will come to know that submit button in iframe is clicked. and how i will get the value from that iframe form. Link to comment Share on other sites More sharing options...
Ingolme Posted September 10, 2008 Share Posted September 10, 2008 The form code of the page inside your iframe should have "_parent" in the target attribute. The form values will be sent through a query string, like usual. Link to comment Share on other sites More sharing options...
pankaj.ghadge Posted September 10, 2008 Author Share Posted September 10, 2008 u r not getting? i just want to take the value from iframe when a user will press the submit button in iframe. i want that value in main page............. Link to comment Share on other sites More sharing options...
Ingolme Posted September 10, 2008 Share Posted September 10, 2008 If you don't want the main page to reload, you're going to have to use Javascript to retrieve the form values from the <input> elements and use them in the main page however needed, accessing the window._parent object. Link to comment Share on other sites More sharing options...
jeffman Posted September 10, 2008 Share Posted September 10, 2008 NOTE. I have drastically oversimplified this markup for the sake of demonstration. Please use best practices in your own documents.Let's call this file shell.html: <html> <head> <script type="text/javascript"> function help (m) { alert(m); } </script> </head> <body> <iframe src="myframe.html"></iframe> </body></html> This file is myframe.html: <html> <head> <script> function send () { window.parent.help("HELLO!"); } </script> </head> <body> <button onclick="send()">send</button> </body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.