Click to See Complete Forum and Search --> : Need help...


Tigerseye
02-17-2003, 03:26 AM
Hi,

I play a game online, and each year we have a tournament to declare the best "fighter" in the game. Granted, it is a text-based game, so fighting is rather simplistic, but, nonetheless...

To be run alongside this tournament, which we call the Goat Cup, I had created a second competition: The Goat Cup Predictor. Each entrant would attempt to "predict" who will win each round of the Goat Cup. The person who correctly predicted the most rounds, would be declared the winner.

Now, that said, I put fairly detailed instructions on how this is supposed to be done. For example, in this tournament format, two people advance from each qualifying round, so the entrant is to choose two DIFFERENT people from each qualifying round. The person they select for Wild Card is supposed to be someone who they hadn't already selected to win his or her qualifying round. And the people they select to win quarter-finals should have been selected to win either their qualifying round or the Wild Card round. The people they select to win in semi-finals should be people they also selected to win in quarter-finals. And the person they select to win in finals should be a person they selected to win in semi-finals.

Anyway, much to my dismay, many people failed to follow these instructions. So, I've decided that for next year, I would like to use JavaScript to make sure that everyone fills in their entries properly. This will be done by populating future pull-down menus based on previous pull-down menus. Unfortunately, I have no idea how I would go about doing this. :( I really only know HTML, and nothing more in the way of programming.

If you would like to view the HTML site used for this year, it's available at http://beam.to/GCpredictor/predictor.html

Thank you for your help! :)

Nevermore
02-17-2003, 04:31 AM
That could be done in two real ways:
Either by using cookise with JavScript, which would have the drawback of stopping people without cookies enabled from playing, or with server-side scripting , e.g. PHP or ASP. These would be better. Does you server support either of these? You would also need some sort of database, e.g MySQL.

Tigerseye
02-17-2003, 02:54 PM
I don't know what any of that stuff is, but if it helps I'm using http://www.brinkster.com for free hosting.

But isn't there a way that I can just use populate and perhaps new Array to make pull-down menu #2 change when a user selects something from pull-down menu #1? Do I really need a database and all this other fancy stuff you listed?

Nevermore
02-17-2003, 02:58 PM
Does the information need to be stored from session to session. If not, no you don't need it, and can just store the variables in an array. If yes, you do. Post whether or not you need to store stuff, and ill get back to you.

Tigerseye
02-17-2003, 03:02 PM
I don't really need anything stored. All of the entries are sent to me by e-mail, and I then record them by hand. I suppose storing might be more convienent, but I don't see it as a necessity, so I probably would not be willing to put that sort of work in. :)

Nevermore
02-17-2003, 03:05 PM
If you used a host that supported php and MySQL, you caould make it store them with about 6 lines of code. Quite easy, really.

Tigerseye
02-17-2003, 03:39 PM
Well, how 'bout we worry about that after we conquer the problem at hand? :)

If you'd be so kind as to return to http://beam.to/GCpredictor/predictor.html ...

There are two things that I would like to accomplish. The first thing is REMOVAL of names from a pull-down menu. As you might notice, there are two pull-down menus for each qualifying round. Therefore, when a name is selected from one pull-down menu, I would like that name removed from the other pull-down menu. This will also be done for the multiple pull-down menus in quarter-finals and in semi-finals. Furthermore, the Wild Card round should remove names that have already been selected to win their qualifying round.

I hope that made sense, let's move on...

The second thing I would like to accomplish is MODIFICATION of pull-down menus. On the quarter-final pull-down menus, I only want NINE names listed: the eight people that the user selected to win in qualifying rounds, plus one person from Wild Card. In semi-finals, I only want four names listed: the winners that the user had selected in quarter-finals. And in finals, there should only be two names listed: the two people selected in semi-finals.

Is this doable? Can you help me? Please let me know. Thank you so much for your efforts! :) And my apologies for being a complete JavaScript dunce.

alex222
02-17-2003, 03:58 PM
Visit http://javascript.internet.com/forms/auto-drop-down.html#source. That example of a pull-down menu shows how you can use a selection in one pull-down menu to alter the contents of another one. I would also hide each round of pull-down boxes until it is time for the person to pick people for that round so they don't get confused.

Tigerseye
02-18-2003, 08:02 PM
bump

Tigerseye
02-20-2003, 09:01 PM
Someone must know?

Nedals
02-20-2003, 10:26 PM
Let me restate the problem to make sure we are on the same page.
The player...
1. Selects a name from each of the 9 dropdowns in the Qualifing Round (2 from rounds 1,2,3 and 4 and the wildcard.)
2. You would like the 4 quarter-final selectors to only display the selections made from the Qualifing Round.
3. The 2 semi-final selectors only display the quarter final selections
4. The final selector only displays the semi-final selections

Not sure where the wild card goes???
What will the quarter-final, semi-final, final selectors display BEFORE anything is selected??
What do you want to do once all the selections have been made?

Is that the problem? If so, it's possible but not easy and will take a little work. Someone may want to take a stab at it.