I’m loading a page in an iframe colorbox. On this page there’s a form which can be submitted. I would like to close the colorbox automatically and load a new url in the parent page after submitting the form. How can I realize this?
now I use an onclick function after submitting the form, but I want this to be done automatically:
<a onclick="parent.$.fn.colorbox.close();" target="_parent" href="http://www.test.com">Test</a>
It’s not completely clear where the issue is.
Generally speaking, you’ll want to use the Submit action on the iframed form to trigger the behavior you desire. For example, you can trap that event and do the following:
You’ve already figured out how to close the colorbox, so study up on parent.window.location and you’re off to the races.
Personally, I would do this in javascript rather than trying to work it out using default browser behavior.
All the best.