Hi All,
I’m having difficulty with iframes as targets for page loads.
When my top page opens, it creates a menu, and an iframe into which items on the menu will load.
Each time the top page loads, the iframe is given a unique name, so that multiple instances of the top page can exist within the browser, each with it’s own iframe.
[code=html]<div id=’m11′ style=’display:block’>
<a href=’/admin/adm10.php’ target=’content856705′ ><img src=’/menu-users.jpg’ title=’Control Panel’ border=’0′></a>
<a href=’/admin/adm03.php’ target=’content856705′ ><img src=’/menu-password.jpg’title=’Password’ border=’0′></a>
<a href=’/admin/adm09.php’ target=’content856705′ ><img src=’/menu-history.jpg’ title=’History’ border=’0′></a>
</div>
You can see that in the above example, the iframe is called ‘content856705’, being ‘content’ plus a random 6 digit number.
The problem has me baffled…
When the user clicks on, say, Password, the password page opens within the iframe as intended. The user changes the password, and submits the form. Note that there is no target in the form (the default should be ‘_self’).
The user then clicks, say, History, and the browser opens the target script in a new window (or tab) instead of the target iframe. Remember that the name of the iframe and the top page haven’t changed, so the target reference should still be valid. All that has happened is that the user have submitted a form within the iframe.
This happens in IE8, Chrome and Safari, but not Firefox.
Any thoughts?
CTB