Jump to content


Photo

SELECT code.


  • Please log in to reply
3 replies to this topic

#1 gfX

gfX
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 19 February 2006 - 03:31 PM

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

<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>


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.

#2 gfX

gfX
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 19 February 2006 - 05:50 PM

Meh, I got it to work.

I used an input box for the number and then used:
for ($i = 0; $i < $_POST[number]; $i++) {

works fine. thanks anyway

#3 gfX

gfX
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 19 February 2006 - 06:03 PM

Okay, I have another issue :

Here is the final 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>";
}

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.

#4 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 20 February 2006 - 08:24 PM

are you asking about how to get the values on the processing script?
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users