|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Metzen Smarty Rookie
Joined: 16 Jan 2004 Posts: 6
|
Posted: Fri Jan 16, 2004 2:02 am Post subject: html_options and class for <option> tag |
|
|
Hi *,
I have a select that I'd like the options in the dropdown to alternate CSS classes, similar to a combination of these (which isn't currently possible, to my knowledge):
Code: | {html_options options=$select_array selected=$select_current name="my_select" class="selectClass"}
{cycle values="optionClassOne,optionClassTwo"} |
So the resulting HTML would be:
Code: | <select name="my_select" class="selectClass">
<option label="One" value="1" class="optionClassOne">One</option>
<option label="Two" value="2" class="optionClassTwo">Two</option>
<option label="Three" value="3" class="optionClassOne">Three</option>
<option label="Four" value="4" class="optionClassTwo">Four</option>
</select> |
The point being the ability to pass things down to the <option>, in addition to being able to pass options to the <select>.
Perhaps this is only of value to me and I should just do it in a {section} and build my own dropdown, but if others see a need for it it would be a nice addition to html_options and could be done without breaking the current implementations.
Thanks,
Metzen |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|