View Full Version : How to limit form registration

Sep 20th, 2007, 04:29 PM
Is there such a script that could limit a form registration.

What I like to be able to do is: have a button that tells the availability (lets say 10 courses left) and every time a client would click the button "Register" it will auto calculate and button will drop to "9 courses left".

Once it reach 0, the register button becomes "disable" automatically with a message that says: registration is full. try another date.

The admin would be able to reset it at any time and change the numbers of availability.

Is this possible to do in Javascript ?

Sep 20th, 2007, 07:18 PM
JavaScript is a client side language...and it has no knowledge of the number of users connecting to the website unless there is a mechanism in place where it contacts the server for course availabilities etc.

Still, you have to use a server side programming language to store and calculate the number of reserved or available places...such as PHP, J2EE, ASP.NET technologies.

so, the answer to your question is no...if you are only using JavaScript...and yes if you are using another server side programming language.

Sep 21st, 2007, 07:41 PM
ok, thanks, I was wondering if there was an easy way to do this...I can do client side asp scripting, but have no knowledge at all when it comes to do server-side programming.

Sep 21st, 2007, 08:09 PM
You can use AJAX which uses server-side but not at the same page.
It just gets information from another server-side page like in your case: Number of users registered.