Jump to content

Is This Logic And Thinking Ok?


MoFish

Recommended Posts

Hello.

 

i'm currently trying to make a small poker league for friend and family events, but am a little confused by the logic.

 

after each game; it is going to be nessasary to report the number of players who played, each players name who participated and there positioning.

 

I was thinking the best way to acheive this, would be to have a page with a listbox at the top - containing the numbers 4-6 for the number of players who played.

 

If the user select's 6 from this listbox; another 6 listboxes will be displayed containing the player names (populated from a database).from here the user may select the players name's and positioning's.

 

This could be done by creating 6 individual pages, but moving to PHP is ament to make things work from one location right?

 

im having problems getting my head round if this is the best way to acheive this.

 

could anyone suggest or confirm this is ok? :)

 

thanks, mofish

 

 

Link to comment
Share on other sites

You can use Javascript or PHP for this.  For javascript, you can generate listboxes like so:

 

function makeBox(boxName, rowCount, optionList) {
     tempList = document.createElement("select");
     tempList.setAttribute("name", boxName);
     tempList.setAttribute("multiple", "true");
     tempList.setAttribute("rows", rowCount);
     for (var i = 0; i < optionList.length; i++) {
          tempOpt = document.createElement("option");
          if (typeof optionList[i].value != "undefined")
               tempOpt.setAttribute("value", optionList[i].value);
          if (typeof optionList[i].selected != "undefined")
               tempOpt.setAttribute("selected", "true");
          tempOpt.innerHTML = optionList[i].label;
          tempList.appendChild(tempOpt);
     }
     return tempList;
}
document.body.appendChild(makeBox("boxname", 5, [{label: "Player Name"}, {label: "Another Player", selected: true}]));

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.