>From my googling I see that this has been asked, and there's no really easy
answer, and none of the few answers I found work for my case.
Basically, you have a label, a value and a category signified by the css
class. I want the output to be something like
<option label="apple" class="fruit" value="1">apple</option>
<option label="spinach" class="vegetable" value="w">spinach</option>
<option label="salmon" class="fish" value="1">salmon</option>
And yes, I know there are option groups for organizing OPTION elements into
a hierarchy, but I have my reasons for not wanting to go there.
This will all come from a database. In high-level terms, how would you
suggest approaching this? What classes/methods would you look into
overriding?
The purpose is to do fancy tricks using jQuery -- I need to detect the
"category" on the change event. I can think of ways of hacking around this,
e.g., load a JSON data structure that maps ids to categories and refer to
that as needed. But... any other ideas?
Thanks.
--
David Mintz
http://davidmintz.org/
It ain't over:
http://www.healthcare-now.org/