Welcome Guest, Not a member yet? Register   Sign In
form_dropdown with image
#4

[eluser]xwero[/eluser]
Then you only have one image or you would have to do something like
Code:
<style type="css/text">
#tester .option1{
     padding-left: 25px;
     background: transparent url(path/to/icon1.png) top left no-repeat
}
#tester .option2{
     padding-left: 25px;
     background: transparent url(path/to/icon2.png) top left no-repeat
}
</style>
<select id="tester">
      <option value="1" class="option1">Option 1</option>
      <option value="2" class="option2">Option 2</option>
      <option value="3" class="option3">Option 3</option>
      <option value="4" class="option4">Option 4</option>
</select>
Which is not very maintainable. But if you use style it would work.
Code:
&lt;?php foreach($countries as $country){ ?&gt;
<option value="&lt;?php echo $country['value']; ?&gt;"&lt;?php echo $country['attr']; ?&gt;>&lt;?php echo $country['value']; ?&gt;</option>
&lt;?php } ?&gt;
where $country['attr'] would output something like
Code:
style="background: transparent url(path/to/flag.png) top left no-repeat;"


Messages In This Thread
form_dropdown with image - by El Forum - 03-17-2008, 08:33 PM
form_dropdown with image - by El Forum - 03-18-2008, 12:18 AM
form_dropdown with image - by El Forum - 03-18-2008, 09:43 AM
form_dropdown with image - by El Forum - 03-18-2008, 09:56 AM
form_dropdown with image - by El Forum - 03-18-2008, 10:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB