OK so I haven't messed with JavaScript in a long time but I do remember some. I have tried Google but it hasn't proved to be what i wanted.
Let's say I have a link... when you click it -- a window pop-up box appears. You can submit the form... then when you press submit! The pop-up box with the form you just filled out would close and the page you clicked the box up box would be redirected....
How would I make that happen?
asked Jul 28, 2010 at 16:06
test
18.3k67 gold badges173 silver badges248 bronze badges
-
Are you referring to a lightbox?strager– strager2010年07月28日 16:09:46 +00:00Commented Jul 28, 2010 at 16:09
-
nope - just a simple pup up box.test– test2010年07月28日 16:36:30 +00:00Commented Jul 28, 2010 at 16:36
1 Answer 1
Try this:
Parent page:
<script type="text/javascript">
window.name="dansMainPage";
function popWin(link) {
var w = window.open(link.href,link.target,'width=500,height=600,resizable');
return w?false:true; // if popup blocker, use the default behaviour of the link
}
</script>
<a href="pagewithform.html" target="_blank"
onClick="return popWin(this)">Pop form</a>
child page:
<form target="dansMainPage" onSubmit="setTimeout(function() { window.close() },1000)">
.
.
.
answered Jul 28, 2010 at 17:38
mplungjan
180k29 gold badges183 silver badges246 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js