[ZPT] <option selected> issue

Michael R. Bernstein mbernstein@codeit.com
09 Mar 2002 19:59:01 -0800


On Sat, 2002-03-09 at 14:18, Chris Withers wrote:
> Hi there, 
> 
> Just noticed that if I have:
> 
> <option tal:attributes="selected some_binary_value"/>
> 
> I get:
> 
> <option value="Reviewer" selected="selected">
> 
> ...which works but is incorrect.
> 
> Surely it should be:
> 
> <option value="Reviewer" selected>
> 
> cheers,
> 
> Chris
> 
> PS: And how come 'selected' behave magically differently from any other
> attribute?

Chris,

You would be correct for HTML 4, but XHTML requires that an attribute
have a value, and that value must be enclosed in quotes. The page
template is simply generating valid XHTML.

The same goes for the disabled="disabled" and readonly="readonly"
attributes of a textarea element, for example.

Cheers,

Michael Bernstein.
-- 
---------------------------------------------------
| Michael Bernstein   http://michaelbernstein.com |
|                                                 |
| CodeIt Computing    http://codeit.com           |
---------------------------------------------------