I have a form with several fields that has a jquery autosave function that saves the form every 3 minutes, and also a button that the user can click to save the form. What I want is a preview feature that loads in a fancybox. Currently, when I click my preview button, fancybox loads using an iframe and pulls the data from a php/mysql process. The preview in fancybox loads, but if the form has changes since the last save, and hasn't been saved since the most recent changes, the fancybox displays the data prior to the latest changes.
$(function() {
$('#preview-article').live('click', function() {
saveTheForm();
$('#preview-article').fancybox({
'width': '80%',
'height': '80%',
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'type': 'iframe'
});
});
});
Any help is greatly appreciated!!!