Smarty html_options uses selected="selected"

While the w3c states that boolean values can be expressed either alone or with an assignment, it also points out that many user agents don't recognize the non-minimized form. For that reason, it would be best if Smarty conformed to the minimized form.

W3C's - On SGML and HTML

For those fighting with this issue, change line 102 of /usr/local/lib/php/Smarty/[libs/]plugins/function.html_options.php.

Versions 2.6.3 - 2.6.5

Boolean attributes

Some attributes play the role of boolean variables (e.g., the selected attribute for the OPTION element). Their appearance in the start tag of an element implies that the value of the attribute is "true". Their absence implies a value of "false".

Boolean attributes may legally take a single value: the name of the attribute itself (e.g., selected="selected").

This example defines the selected attribute to be a boolean attribute.

selected (selected) #IMPLIED -- option is pre-selected --

The attribute is set to "true" by appearing in the element's start tag:

<OPTION selected="selected">
...contents...
</OPTION>

In HTML, boolean attributes may appear in minimized form -- the attribute's value appears alone in the element's start tag. Thus, selected may be set by writing:

<OPTION selected>

instead of:

<OPTION selected="selected">

Authors should be aware that many user agents only recognize the minimized form of boolean attributes and not the full form.