It's like this now, but
$body.='<select name="number" id="";
// Onchange function is performed when combo box contents are changed
$body.=$row["ID"].'onchange="changeNumber(this);">';
// Convert quantities to numbers
$qty=(int)$row["quantity"];
for($number=0;$number<=10;$number++){
$body.='<option';
if($number==$qty){
$body.='selected value=''.$number.'>'.$number.'</option>';
} else{
$body.='value=''.$number.'>'.$number.'</option>';
}
}
$body.='</select>';
I don't know input type="text" name=number value="?"
...
"By the way, I think HTML often calls it ""select box"" instead of combo box."
For the existing code, <select>
allows you to select a choice, but if you want it to be entered arbitrarily in a text box, you can print the following HTML:
<input type="text" name="number">
The value entered in the displayed HTML is sent as value
, so when you output HTML,
<input type="text" value="...">
is not required.
© 2023 OneMinuteCode. All rights reserved.