How to submit iframe in current page
Hello , i have index.php and somewhere inside it i have an iframe of index2.php , index2.php has this code
Code:
<a href="javascript:{}" target="_parent" onclick="document.getElementById('form1').submit(); return false;">Submit</a>
but when i click it , the page loads inside the iframe , so im still at index.php but i have iframe with different content.... how can i manage "load" the page at index.php window ?
Re: How to submit iframe in current page
Couple issues.
1. Your href attribute is invalid JavaScript. That should be throwing errors in some browsers.
2. Since it's submitting a form, changing the target in the actual anchor tag will do nothing.
Code:
<a href="#" onclick="document.getElementById('form1').submit(); return false;">Submit</a>
<form target="_parent" ... >