Execution sequence. Submit form after execution of code
I have combined the jquery form plugin and the populate form plugin according to this:
-
$(document).ready(function(){
$(\'#form2\').ajaxForm({
dataType: \'json\',
success: pop
});
});
function pop(data) {
$(\'#form\').populate(data, {resetForm:false});
}
So when user submits "form2" json data is retrieved from a php script and populated to "form". This works fine. Now my problem is that I want to submit "form" automatically after all the above code has executed and "form" has been filled with the json data. In other words "form" needs to be submitted with fresh data from the executed script. Have tried a few ways but always get stuck. Any help appreciated.