1

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
2
  • Are you referring to a lightbox? Commented Jul 28, 2010 at 16:09
  • nope - just a simple pup up box. Commented Jul 28, 2010 at 16:36

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.