gfX Posted February 19, 2006 Share Posted February 19, 2006 Hi, I'm making a "Skill Creator" for my Text-Based game .. and I was wondering if this is possible:I want a drop down list for the number of Items I would want to put .. So it would be like[code]<B>Number of Items:</b><BR><select name="number"><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option></select>[/code] And so on .. And when I select one of those options, I want it to automatically underneath add input boxes of how many numbers I chose. Sorry if that doesnt make sense.So if I select 6 from the drop down list then it would create 6 input boxes right below it..Thanks if anyone couold help me.. or if there is a better way to do this. Quote Link to comment https://forums.phpfreaks.com/topic/3482-select-code/ Share on other sites More sharing options...
gfX Posted February 19, 2006 Author Share Posted February 19, 2006 Meh, I got it to work.I used an input box for the number and then used: [code]for ($i = 0; $i < $_POST[number]; $i++) {[/code]works fine. thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/3482-select-code/#findComment-11961 Share on other sites More sharing options...
gfX Posted February 19, 2006 Author Share Posted February 19, 2006 Okay, I have another issue :Here is the final code:[code]$numbervar = "<table cellspacing=5 cellpadding=5><tr><th><font face=\"verdana\" size=\"1\">Item Name</th><th><font face=\"verdana\" size=\"1\">Experience</th><th><font face=\"verdana\" size=\"1\">Clan Exp</th><th><font face=\"verdana\" size=\"1\">Level to Make</th></tr>";for ($i = 0; $i < $_POST[number]; $i++) {$numbervar .= "<TR><td align=center><input type=\"text\" name=\"item_name[]\" size=\"30\"></TD><td align=center><input type=\"text\" name=\"item_exp[]\" size=\"5\"></TD><td align=center><input type=\"text\" name=\"item_cexp[]\" size=\"5\"></TD><td align=center><input type=\"text\" name=\"item_level[]\" size=\"5\"></TD></tr>";}[/code]Okay so if I enter 5 and then it comes up with 5 Input Boxes, What are the values gonna be? (name)Cause I need the value of each Item name and item exp, etc. Quote Link to comment https://forums.phpfreaks.com/topic/3482-select-code/#findComment-11964 Share on other sites More sharing options...
ryanlwh Posted February 20, 2006 Share Posted February 20, 2006 are you asking about how to get the values on the processing script? Quote Link to comment https://forums.phpfreaks.com/topic/3482-select-code/#findComment-12017 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.