Forum Moderators: coopster & phranque

Message Too Old, No Replies

form that deletes selected choices

         

audioone

10:46 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



I'm looking for a form that allows users to make a selection, then lets me know what the selection is, then deletes the selection from the form so no one else can choose the same thing. Is there such a thing? Or can I modify a formmail form to accomplish this?

hakre

1:51 am on Nov 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi audioone,

what kind of selection do you mean?

shady

2:09 am on Nov 6, 2003 (gmt 0)

10+ Year Member



If you want a selected option to be unavailable to others, you will need a database driven application (e.g. php/mysql) to store information about the selections to be able to remove these options from others.

It sounds like a fairly unusual idea, so I wouldn't expect you to find your answer outside of bespoke programming :-(

Best regards
Shady

jatar_k

2:16 am on Nov 6, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld audioone,

how about this for a possibilty

1. db or file holds all possible choices
2. on load the form reads and displays all available choices
3. user selects choice and submits
4. processing script emails the selection to you and removes the option/selection from the db or file

make sense? wouldn't be overly difficult to code in either perl or php. I would figure shady is right that there may not be a predesigned script for this but it is fairly straight forward.

Are you familiar with either perl or php?
Which does your host offer?

[edited by: jatar_k at 2:31 am (utc) on Nov. 6, 2003]

audioone

2:30 am on Nov 6, 2003 (gmt 0)

10+ Year Member



Jatar_k's idea is exactly what I want. My server supports perl, and if I have the general idea which code words to use I can usually muddle thru.

jdMorgan

4:00 am on Nov 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



audioone,

Be careful... You have the makings of a classic 'glare' condition here.

If it is required that two people may never make the same choice, you will have to add steps to confirm to each submitter that his/her selection was accepted, and if not, to offer a new form with the revised currently-available selections.

This kind of system can break down badly under heavy load, even if implemented properly. There's always some unlucky person who submits 10 milliseconds after his/her first choice is taken, then resubmits 10 milliseconds after the second choice is taken... I think you see what I mean here -- the system can be very 'unfair' if several people are selecting simultaneously...

Depending on time scales and traffic, you might even want to implement an automatic page refresh every 3 to 15 seconds to help prevent this problem... Plus, it lets people see the choices dwindling (if that is a benefit to your site).

Too many years spent doing worst-case analysis I guess, but forewarned is forearmed...

Jim

audioone

2:49 pm on Nov 6, 2003 (gmt 0)

10+ Year Member



Thanks, Jim, this makes perfect sense. I will do this if I can figure out how to make the form work.