Disabling form and loading in screen

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Pezmc
Forum Commoner
Posts: 53
Joined: Mon Nov 06, 2006 2:15 pm

Disabling form and loading in screen

Post by Pezmc »

I have just created a digital questionnaire for some year 7's at my school. However the school server is quite slow and the pages take quite a long time to load. Many of the year 7's click the submit button multiple times and wreck the database.
Recently I saw on a website a form that when you submitted it, it filled the screen with 50% opaque black. And in the middle it said loading..., how does this work, does anyone have the script, does anyone have a better solution?
Thanks in advance
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

The simplest solution would be to set an onSubmit() action on the form that immediately disabled the submit button.

If you want fancier - like what you suggested - it'd just be a matter of using the proper CSS on a div, then making it visible when the form was submitted.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply