Currently I fill a select box with the following code:
<select name="klas_jaar" value="{jaar_id}">
<?php foreach ($jaren as $jaar):?>
<option value="<?=$jaar->jaar_id?>"><?=$jaar->schooljaar?></option>
<?php endforeach;?>
</select>
The value set is the same id as a option’s value.. however it doesn’t put the requested value as selected when going to this page.
What am I doing wrong?
selecttags don’t have avalueattribute. Instead, you have to drop aselectedattribute in the appropriateoption.