MoFish Posted April 17, 2007 Share Posted April 17, 2007 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 https://forums.phpfreaks.com/topic/47475-is-this-logic-and-thinking-ok/ Share on other sites More sharing options...
btherl Posted April 18, 2007 Share Posted April 18, 2007 You can create new inputs on a page using javascript.. i'm unsure of the details however. Link to comment https://forums.phpfreaks.com/topic/47475-is-this-logic-and-thinking-ok/#findComment-231757 Share on other sites More sharing options...
Glyde Posted April 18, 2007 Share Posted April 18, 2007 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 https://forums.phpfreaks.com/topic/47475-is-this-logic-and-thinking-ok/#findComment-231771 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.