I'm uploading files in vf page form (site force.com) using remote action.
I want to wait for the remote action will finish its method, and only then proceed - means - do it synchronously, because I need all the files will be loaded before submitting the form.
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.PaymentFormController.dfqwerFile}',
var1,var2,var3,var4,var5,
function(result, event){
if (event.status) {
console.log('status',event.status);
} else if (event.type === 'exception') {
console.log('failed');
} else {
console.log('Succes');
}
},
{escape: true}
);
Any way to achieve it?
Thanks!