Search code examples
javascriptjqueryformsshadowbox

Pull form from shadowbox, and submit it from the parent window


I have a form in a shadowbox, and when the user clicks the submit button (or a link with an onclick, i don't mind) i want to step in, close the shadowbox, then submit the form data from the parent window. Can anyone tell me how to do this? I can't work it out.

Something like this semi-pseudocode...

$("#my_form").submit(function(){
  var parent = window.parent;
  parent.Shadowbox.close();
  parent.submit($(this));
}

thanks, max


Solution

  • If you're not picky about closing the shadowbox first, you can just use a target="_parent" in the form tag.