Forum Moderators: open

Message Too Old, No Replies

iframe opens in new page

         

jackvull

10:19 am on May 1, 2008 (gmt 0)

10+ Year Member



I am submitting a form to an iframe to process some SQL on a server.
The problem is that when I submit the form, it opens a new page rather than using the iframe. Any ideas why?
[code]
<form method='get' target='updateframe' name='updateframe'>
etc.
etc.
</form>

<iframe id='updateframe' src='kpi.php'>

</iframe>

daveVk

11:51 am on May 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try changing iframe id and target to something other than form name.

penders

9:01 am on May 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...or move the name attribute.

The target of the form needs to refer to the name of the iframe ('updateframe' I presume), so it looks like you should move your name attribute from your form to your iframe. But you also need to specify an action for the form, otherwise it will default to itself (which I guess is not your kpi.php file?)...

<form action="kpi.php" method="get" target="updateframe">  
:
</form>

<iframe id="updateframe" name="updateframe" src="kpi.php">
:
</iframe>

Just to note... the name attribute of the form is generally not required these days with modern scripts and importantly is deprecated in XHTML. (W3C XHTML1.0 - The elements with 'id' and 'name' attributes [w3.org])