I've been experimenting with chosen and was using it with data from MySQL database. I stumbled upon a problem when using a selected value in hope for updating it's previous value. Here's my code:
<label>Client
<select data-placeholder="Choose a client..." class="chosen-select" style="width:350px;" tabindex="2" name="client">
<option value=""></option>
<?php
$cno=$h['client-no'];
$c=mysql_query("select * from `clients`") or die(mysql_error());
while($d=mysql_fetch_array($c))
{
?>
<option value="<?php echo $d['client-name']; ?>" <?php if ($d['client-no']==$cno) { ?>selected="selected"<?php } ?>>
<?php echo htmlspecialchars($d['client-name']); ?>
</option>
<?php
}
?>
</select>
</label>
But it doesn't work. What am I doing wrong?