Close popup window after submit then redirect to parent
as the title says, "close popup window after submit then redirect to parent".
how do i do that?
i google it and i saw that some people are using the following code:
window.close();
window.opener.location.reload();
The problem is, i dont know how to use and where them.
pls guide me. Ime really a newbie in javascrpt...
p.s.: I use window.open to open the popup window.
Thanks! :)
rakwel10
Junior Poster in Training
68 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
it did solve my problem :) thanks
rakwel10
Junior Poster in Training
68 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
more and more users do not allow popup windows, the code will fail
better than a popup is a layer in the original page, that can be hidden or displayed at will, with a z-index higher than the rest of the page.
layers in the current page cannot be blocked by popup blockers
layer in this instance refers to an element sized and positioned to overshadow all other items in the page
onclick='formname.display:block' for this element shows the contents of the div(example) and hids all other content onsubmit='formname.display:none;' returns to the prior page, no-popups
not code sample, a thought exercise
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
more and more users do not allow popup windows, the code will fail
better than a popup is a layer in the original page, that can be hidden or displayed at will, with a z-index higher than the rest of the page.
layers in the current page cannot be blocked by popup blockers
layer in this instance refers to an element sized and positioned to overshadow all other items in the page
onclick='formname.display:block' for this element shows the contents of the div(example) and hids all other content onsubmit='formname.display:none;' returns to the prior page, no-popups
not code sample, a thought exercise
Hi almostbob!
Thanks for informing me..
Im now thinking to get rig of this popup thing..
Can you help me how to do what you are saying?
Sample codes will help.
Thanks
rakwel10
Junior Poster in Training
68 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
sample
<script type="text/javascript">
<!--
function hideIt() {
if(document.getElementById) { document.getElementById('layer1').style.visibility='hidden';}
if(document.layers) {document.layers['layer1'].visibility='hide';} }
function showIt() {
if(document.getElementById) {document.getElementById('layer1').style.visibility='visible';}
if(document.layers) {document.layers['layer1'].visibility='show';} }
--></script>
<button style='top:0;' id='openform' onClick="showIt();">fill form</button>
<div id="layer1" style="position:absolute; left:0; top:0; width:100%; visibility:hidden; padding:30%; margin:0; background:#ececec; border: 1px solid;">
Form
<form onsubmit="hideIt();top.location.reload();" action='somefile' method='post'>
something? <input name='somename' type='text'>
<input type='submit'>
<button id="form" onClick="hideIt();">Close without completing</button>
</form>
</div>
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376