Page 1 of 1

Submitting a form to an iframe

Posted: Wed Aug 31, 2005 4:40 pm
by evilmonkey
Hello,

I have a page that has an iframe in it. I have a field on that page that the user can fill in, and if he does, the stuff in the iframe updates (like a shoutbox). The feild is on the parent page, but the shoutbox content is in the iframe. How can I solve my problem? If possible, I would like to do it with javascript, but if there's no way, javascript it is. I tried looking up some solutions on google, but couldn't understand what the people were talking about (I have 0 knowledge of JS).

Thanks for the help.

Posted: Wed Aug 31, 2005 4:43 pm
by feyd
if memory serves, it should be like submitting to a different frame/window would be. Set the target attribute in the form element. If you're wanting to use XHTML validation, you'll need to use some Javascript trickery to add the target attribute after page load, but it's still the same.

Posted: Wed Aug 31, 2005 4:50 pm
by s.dot

Code: Select all

<iframe name="iframe" src="page.php"></iframe>

<form action="page.php" target="iframe" method="post">

Posted: Wed Aug 31, 2005 4:51 pm
by evilmonkey
Ah, okay, this simplifies matters, thanks. :D