Passing a variable to any page by clicking a link
June 26, 2004
Javascript | Questionmark Perception

I am working on a game which requires people to log in by selecting whichever team they are on. Each team is made up of several departmental units.

People probably won't know what team they belong to the first time they play. There is no list of all the potential players, so it isn't possible to automatically associate users with teams. So we constructed an entry page which lists all the departments and which teams they belong to. People find their department, and are automatically associated with a team.

It required creating a little script to pass the name of the team along to the game login page.

Presumably people WILL know what department they are in, and will be able to select their team in that manner.

The problem was, the team name has to be passed to Questionmark Perception's login page, since it requires the team name to send whatever points are earned to the appropriate team.

I used the following javascript to set a hidden field "GROUP" on Questionmark's login page, when a player clicks the team link on the Entry page.


Ads by Google

Posted by ellen at June 26, 2004 10:03 PM The team link opens the login page then passes the variable, so they can type in their name and start the game. I probably could have had the script submit both name and group through the login page, but decided against it. The login page is the only one that can pass the variable to the game - there are security features that ensure it only comes from that page. And I wanted them to be properly awed by the cool graphics on the login page.

Each team name link is set up like this:


Ads by Google


Ads by Google

 RSS   |   Contact Me


Ads by Google