Loading bar while the form is sending

I have a form which has an upload button. Only when the user click on “submit”, the file start to uploads. When the form is properly saved, show the message. But in this meanwhile, the user have no visual about the files are uploading. In text-only forms, this time is so small to be percitible. But my form has “large” files. Around 10MB. is sufficent to user click over and over on button.

I tried to put a “loading” gif to show only after click on button and only the error message not visible. The error message is about required fields. But have no luck. My best code works only on second click. Any help?

the gif property is “Hidden on load” and the code is:
msg is the error message text which appear when the button is clicked, but the required fields aren´t properly filled.

export function button2_click(event) {
if ($w(‘#msg’).isVisible)
$w(‘#gif’).hide();
else
$w(‘#gif’).show();
}

Erimar, what you need to do is this (assuming you use a wix dataset):
0) put something on screen (like yout gif) and Hide it by default

  1. on the onBeforeSave of the dataset, disable Submet button (with a 1 seconf time out to register)
  2. on the onAfterSave, hide the GIF again, enable buttons again, etc

I use this trick witj an animated gif on top of the image placeholder and it works well.

Hope this helps.