Many instances when I have html like this, i follow it with jquery to set the value. However I feel this is not the best way to do it and was looking for alternatives.
<select class='papertype' name='papertype'>
<option value='glossy'>Glossy</option>
<option value='matte'>Matte</option>
<option value='luster'>Luster</option>
<option value='metallic'>Metallic</option>
</select>
$(document).ready(function(){
$('.papertype').val('<?php print $image->paper_type; ?>');
}
Im hoping to do this without using any type of javascript, completely server side. An important factor thats causing the problem is that the page I am coding right now has multiple instances of .papertype
, all of which will have different values. Thanks for any help!