If I'm using the colorbox plugin, how do I submit a form via ajax and then make a new modal out of the response? For example, the user clicks a link and a modal pops up. They fill out the form and click submit and then the modal should change to the next form. Then they fill out the next one etc...
A:
You should be able to load the <div id="cboxLoadedContent">
from the first colorbox invocation with the result of your ajax call:
$('#cboxLoadedContent').load('form-process.php', formData);
If the new form you're loading is a different size you should also call the colorbox resize() method to adjust the size of the modal:
$.colorbox.resize();
Pat
2010-07-28 19:02:15