OK, got it. File to edit is includes/functions/html_output.php (though since it can't be overridden, I would suggest be careful during upgrades)
Around line 501 you should have the following code:
Code:
for ($i=0, $n=sizeof($values); $i<$n; $i++) {
$field .= ' <option value="' . zen_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
$field .= ' selected="selected"';
}
Change it to:
Code:
for ($i=0, $n=sizeof($values); $i<$n; $i++) {
$field .= ' <option class="' . zen_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '" value="' . zen_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
$field .= ' selected="selected"';
}
Two notes: 1) It provides a different output than I wanted above, because for some reason you can't style a class if it's all numbers. So class="70" can't be styled.. don't ask me why.. I couldn't do it for some reason. Maybe theres a way to do it and I just overlooked it
2) ALL dropdown forms will have a class now, and the class will be whatever the text is for the option. So, for example, lets say I have the following:
Code:
<option value="70">Zencart</option>
<option value="71">Red</option>
etc
It will now read:
Code:
<option class="Zencart" value="70">Zencart</option>
<option class="Red" value="71">Red</option>
etc
For more control over it I would suggest prefixing it with something so the classes don't conflict with something that may already exist.
Bookmarks