Form Submission Failure Preloader Not Working

I have a form where users come to submit images via Wix Code user input form that connects to a database.

I have added a custom preloader that suggests to the user their images and form are being uploaded and saved.

I’ve tested the form several times: When all fields are valid, the preloader works, the form saves, the success message appears and I’m redirected to a thank you page.

But when a field is invalid or incomplete, the preloader works, the error message appears, but then both the preloader and error message don’t go away. This means the user can’t correct their form fields and move on.

So, how do I make the preloader disappear after a failure/error message?? Please Help!

Link to the form: www.darkyellowdot.com/submit

I’m not very code literate at all, but I’ve gotten this far. Here’s what my code looks like for the preloader:

export function button1_click(event, $w) {
$w(#box6’).show();
$w(‘#dataset1’).onAfterSave(()=>{
$w(‘#box6’).hide(“fade”);
})

1 Like

Hi Lauren,
I’m having the same issue. Did you get it resolved? If so, can you please share the code used.
Regards,
Jodie

Hey I have a hack for this issue

What you can do is you can you have to put default failed message to the preloader box and then you have to enable onViewport event for failed message text then write the code to hide the preloader box when this success message show

export function failedMessage_viewportEnter(event) {

$w( "#PreloaderBox" ).hide(); 

}

What this code does when your form submission failed then the default failed message show and and the default message shows we use onViewport function which will hide the preloader box