View Full Version : HTML form load in PHP iframe
Markpyro
12-22-2005, 2:35 PM
Im trying to make a form, where, when submitted, php will analyze the data and output a response. I dont want it to reload in a different page, but in an iframe beneath the form. Is this possible?
example page (http://pyrom.net/pyro/temp/page1.php)
Thanks,
Markpyro
Fenguin
12-22-2005, 3:16 PM
You can use AJAX.
BSTRhino
12-22-2005, 4:11 PM
The easiest way I can think of doing it is to have the form fields you need in the IFRAME as hidden fields, and when the user clicks the button, transfer all the form values over to the IFRAME form and submit that. Naturally enough, because the form being submitted is actually in the IFRAME, the result will appear in the IFRAME.
WeekendLazyness
12-22-2005, 5:51 PM
<iframe src="frame1.php" border="0">
Add the attribute id="iframe"
<iframe src="frame1.php" border="0" id="iframe">
The frame1.php page will appear in the IFRAME.
Centreri
01-20-2006, 11:09 AM
Yes, I don't see any problem with simply sending the data to the Iframed page, though I haven't experimented a lot. Just make check if it refreshes upon getting the data, and if not use Javascript or something to make the page refresh when the user clicks the button.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.