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 Quote Link to comment 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. Quote Link to comment 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}])); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.