Stuck again... :)
I am returning close to 60 records from a search in mysql. I want to add these records to a select box.
When I am looping through the records, it adds a select box for each record. Not sure where I am going wrong. It does load the correct values, but one in each select box... -
<?php foreach($recordset as $record){ ?>
<select name="model" id="model" class="searchselectbox" onClick="toggleVisibility('pricelabel'); toggleVisibility('price');" onchange="this.form.submit();">
<?php echo '<option value="'.$record['type'].'">'.$record['type'].'</option>';?>
</select>
<?php
}
?>
I had the code like this below as well, still adding a select box for each record...
<?php foreach($recordset as $record){ ?>
<select name="model" id="model" class="searchselectbox" onClick="toggleVisibility('pricelabel'); toggleVisibility('price');" onchange="this.form.submit();">
<option value="<?php echo $record['type'];?>"><?php echo $record['type'];?></option>
</select>
<?php
}
?>
How can I get the option values loaded into only ONE select box? I have found plenty sample codes reflecting the above, mine just don't seem to want to work. :)