views:

278

answers:

1

Hi all.

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

+1  A: 

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

Kevin
ah, that's a great tip, i didn't know that. Thanks Kevin! (i'm not picky about closing the shadowbox first as it happens)
Max Williams
No problem, I just learned that myself and remarked how easy it was :)
Kevin