songohan
Posts: 89
|
| Posted: 09/23/2004, 3:03 AM |
|
Good day all!
Well I have one question. I have tu make registartion form fith name, suremame, adress and stuff and also person must choose one of five workgroups to join. Now, wokgroups will be in list box.
What I do not know how to do is how to limit number od users per workroup, there can max 20 people in one workgroup.
How to make it so that when one fills the form and clicks Submit, if workgroup is full gets note "please select another workgroup".
Many thanks
Andrej
|
 |
 |
crecalde
Posts: 13
|
| Posted: 09/25/2004, 10:44 PM |
|
Songohan:
It seems that you can do a simple check before the user even starts, probably during the initialization stage of the page. (I believe you'll find a prepare() function for this.) There you should something like:
Select count(*) from UsersTable where workgroup_id = ListBoxWorkgroup(1 to 5).
Do not populate the listbox with any workgroups that are already full.
Of course, this assumes that you are not in a high transaction environment. So, you will have to add another check in BeforeInsert and BeforeUpdate that performs a similar count. If the selected workgroup has filled up during the time the user was interacting with the browser, you will have to display a message, and ask the user to select a new group.
Good Luck,
C.
|
 |
 |
|