Change cursor state to waiting while form processing

Issues related to forms.
Post Reply
winprgrmr
 
 
Posts: 3
Joined: Fri Mar 31, 2017 4:04 am

Change cursor state to waiting while form processing

Post by winprgrmr »

I'm sure this has been asked before, but I cannot find an answer that seems to work for me. Does anyone have a working method for changing the cursor to 'waiting' or 'busy' state while a form is processing?

I am using a standard form, with a standard Submit button using built-in PHP form processing. A confirmation page is displayed once processing is complete. Everything works great, but my users get inpatient and keep pressing the submit button when they don't see the browser page is active. (Sometimes I get the same information posted 5 or 6 times!) The main culprit is that the cursor has not changed after the initial submit to indicate that something is in process. I need something ... some indicator that the submit is active and processing. Anytime I put anything in the Events for the button, it overrides the submit and doesn't process.

I've tried using CSS (body.waiting * { cursor: wait; }), JavaScript (document.body.className = 'waiting';), changing the button state, but nothing works gracefully.

Does anyone have a proven solution that they use regularly?

Thanks in advance for your help!!
User avatar
Pablo
 
Posts: 22504
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change cursor state to waiting while form processing

Post by Pablo »

Normally, a form is processed instantly and there is no need to wait. The email is sent by the server, not by the browser.
But if you want to prevent the button from being pressed multiple times then why not disable it after the first click?
This can be done with events.
User avatar
BaconFries
 
 
Posts: 5653
Joined: Thu Aug 16, 2007 7:32 pm

Re: Change cursor state to waiting while form processing

Post by BaconFries »

Anytime I put anything in the Events for the button, it overrides the submit and doesn't process.
See the following
https://wysiwygwebbuilder.com/forum/vie ... 10&t=37833
winprgrmr
 
 
Posts: 3
Joined: Fri Mar 31, 2017 4:04 am

Re: Change cursor state to waiting while form processing

Post by winprgrmr »

Pablo wrote: Fri Dec 16, 2022 7:25 am Normally, a form is processed instantly and there is no need to wait. The email is sent by the server, not by the browser.
But if you want to prevent the button from being pressed multiple times then why not disable it after the first click?
This can be done with events.
I have tried this using the CLICKED event, but I lose the form submit. Perhaps I am not thinking of a workaround using other events? I will take a look at the link supplied by BaconFries to see if there is any help there. Thanks for the prompt reply.
User avatar
Pablo
 
Posts: 22504
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change cursor state to waiting while form processing

Post by Pablo »

I have tried this using the CLICKED event, but I lose the form submit.
This behavior is documented here:
https://wysiwygwebbuilder.com/forum/vie ... 10&t=37833
windsurfer
 
 
Posts: 189
Joined: Mon May 13, 2019 9:15 pm

Re: Change cursor state to waiting while form processing

Post by windsurfer »

I have a form where clients can send me files via email.
I would like to show a progress bar when the submit button is pushed.
I have
onclick javascript return true ;
onclick Enable upload_animate

It will submit the form but it won't show the spinner.
I initially hide the spinner on the page
Can that be done ?
I used to have a photographic memory but i ran out of film !!!
User avatar
Pablo
 
Posts: 22504
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change cursor state to waiting while form processing

Post by Pablo »

Displaying a progressbar will not work, because the form is processed in the server. There is no way to get the status from the server.
windsurfer
 
 
Posts: 189
Joined: Mon May 13, 2019 9:15 pm

Re: Change cursor state to waiting while form processing

Post by windsurfer »

So i can't create an event after i push the submit button ?
I used to have a photographic memory but i ran out of film !!!
User avatar
crispy68
 
 
Posts: 2913
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Change cursor state to waiting while form processing

Post by crispy68 »

I'm curious, why is it taking so long for your form to process to where you would even need a progress bar? The forms I've created all seem to process very quickly. Could it be a server issue?
windsurfer
 
 
Posts: 189
Joined: Mon May 13, 2019 9:15 pm

Re: Change cursor state to waiting while form processing

Post by windsurfer »

People can attach up to 10 files so it may take some time to process, so would be nice to have a progress bar or some indication that the form is processing.
I used to have a photographic memory but i ran out of film !!!
User avatar
Pablo
 
Posts: 22504
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change cursor state to waiting while form processing

Post by Pablo »

So i can't create an event after i push the submit button ?
Yes, you can, but there is no progress update, so it will have no use.

Alternatively, you can take a look at this:
http://wysiwygwebbuilder.com/fileuploader.html
http://wysiwygwebbuilder.com/dropzone.html
User avatar
crispy68
 
 
Posts: 2913
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Change cursor state to waiting while form processing

Post by crispy68 »

Ok thanks. That makes sense.
windsurfer
 
 
Posts: 189
Joined: Mon May 13, 2019 9:15 pm

Re: Change cursor state to waiting while form processing

Post by windsurfer »

Yes i looked at those but they upload the files to the server. I need them emailed to me.
I used to have a photographic memory but i ran out of film !!!
windsurfer
 
 
Posts: 189
Joined: Mon May 13, 2019 9:15 pm

Re: Change cursor state to waiting while form processing

Post by windsurfer »

I added dropzone to my contact us form but after selecting a file it won't send the email or upload to the server. also fileuploader does the same.
I the form properties advanced i selected the mail engine as sendmail. and file upload to the folder upload and the folder is on the server.
I looked at the help file but there is not much there for instructions.
I used to have a photographic memory but i ran out of film !!!
User avatar
Pablo
 
Posts: 22504
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change cursor state to waiting while form processing

Post by Pablo »

dropzone is form by itself so it should not be part of another form.
There is no script with a progressbar to email the file, so if you need that then you will have to implement it yourself.
windsurfer
 
 
Posts: 189
Joined: Mon May 13, 2019 9:15 pm

Re: Change cursor state to waiting while form processing

Post by windsurfer »

When on the submit button on the form is pressed yes, the form does do validation for required inputs though.
I used to have a photographic memory but i ran out of film !!!
User avatar
crispy68
 
 
Posts: 2913
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Change cursor state to waiting while form processing

Post by crispy68 »

My demo form doesn't do anything other than redirect to a success page. As long as it stays on the form page, the progress spinner will be seen until the redirect happens. However, if the validation is incorrect and stays on the page for the user to correct then the spinner will still be seen as the spinner is shown when the submit button is clicked. So technically, the spinner needs to be only shown AFTER validation occurs unless it is redirecting to the error page. This will be a bit more complicated then and I don't think can be done just by using a simple event.
Post Reply