sanders sanders - 1 year ago 128
jQuery Question

jquery fade popupwindow

I am using the popupwindow plugin for jquery to show a form in a popupwindow.
How can I close this window after submitting?
This is the link I am talking about.
I can open a link in a pupup window. But after submitting I want it to open in its parent window.

Answer Source

You can attach the behavior to your link, in the popup-ed page:

<a href="javascript: self.opener.location = ''; self.close();">
     Let's go Somewhere

Additionally, I recommend you to use Javascript in an unobtrusive way instead of using the simple line above.

About that "Fade" operation; You can't do such a thing to the OS window using Javascript (no matter what).

Update: Assuming the form with id property theChildForm and using jQuery:

$("#theChildForm").submit(function() {
     // TODO: Some data keeping jobs to be done
     // Pass the url if needed
     self.opener.location = '';
     // ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download