im going cracy i couldent work a code like this for return a droplist whith selected items from a array.
could anyone help me?
<select onChange="documentDirty=true;" name="tallas[]" size="4" multiple id="tallas[]">
<?php
for ($i = 15; $i <= 45; $i++) {
$a= array(16,17);
if($i =$a ){
echo "<option value=’$i’selected>$i</option> ";}
else{echo "<option value=’$i’>$i</option> ";}
}?>
</select>
thanks
Found your problem!
$i can’t equal an array. It must equal a specific record in an array.
$a[n] where n is the record.
thanks for the help i solve it whith this code
<select onChange="documentDirty=true;" name="tallas[]" size="4" multiple id="tallas[]">
<?php
for ($i = 15; $i <= 45; $i++) {
$a= array(16,17);
if($i==$a[0]or$i==$a[1]or$i==$a[2]){
echo "<option value=’$i’selected>$i</option> ";}
else{echo "<option value=’$i’>$i</option> ";}
}?>
</select>