Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using PHP coding to get some data from SQL tables or to insert data, it takes a few seconds, causing the user to hit the form submit button several times, leads to duplicate the entered data!
Is there any way to show a 'Please wait' message, locking the screen?

What I have tried:

I tried using some ready made javascript using ajax codes, but all of them are focusing on web page loading, my issue is that, the page is already loaded, form data is completed, and user is waiting for server response!
Posted
Updated 15-Sep-20 10:21am
Comments
ZurdoDev 15-Sep-20 14:30pm    
Also, in Javascript you can disable the submit button when they click it. Lots of examples online.
[no name] 15-Sep-20 20:39pm    
"Please wait" won't keep them from hitting the button; you need to think of something else to keep from getting "duplicate data."

1 solution

Quote:
but all of them are focusing on web page loading, my issue is that, the page is already loaded, form data is completed, and user is waiting for server response

On the event trigger when you wait for the server response, on client side using jQuery/JavaScript, play with CSS to setup an overlay or a message as desired. Once response is back, toggle back the css. Main part of the CSS would be to have a style with high z-index to kind of give an overlay feel (thus, page would be unclickable).

Try this: How to Show Loading Spinner in jQuery[^]
 
Share this answer
 
Comments
Member 14819235 18-Sep-20 23:55pm    
That was helpful, thank you so much
Sandeep Mewara 19-Sep-20 5:12am    
welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900