We would like some help/guidance in identifying the best/correct way in approaching the following form
We have a sports league and would like to collect the results of our players, and to make it simple to use we would like to select the number of players who had taken part in the weekly game then select their name from a dropdown list.
There could be anywhere between 3 players up to 50 players
To prevent a player from been selected more than once, would it be possible to iterate the displaying of each dropdown to exclude all the previously selected players from the dropdown in focus?
So the concept would be along the lines of:
#1 Dropdown -> list all players -> (player_6 Selected)
#2 Dropdown -> list all players != player_6 -> (player_25 Selected)
#3 Dropdown -> list all players != player_6 || player_25 -> (player_4 Selected)
Hope this all makes sense
Any help or suggestions on the best way to approach this form would be most appreciated
You would populate the first dropdown list by selecting the participants of the event from the database. The participants for the event must be known at this point; otherwise, the dropdown list would contain all members of the league.
If you already know the participants; why ask for the count?
You could use ajax to populate the dropdown lists for the second and third place entries, using the participant list and excluding players previously selected. This approach would force the user to select the winners in order, first to third. When there are over ten participants, reducing the dropdown list by two members does not noticibly benefit the user.
If the goal is to avoid duplicates being selected, why not just use a form validation script (http://www.w3schools.com/JS/js_form_validation.asp)? You probably need one anyway to check that all fields are entered.