Fog Creek Software
Discussion Board

selected And checked

First off, thanks for a great product.

Two functions in util.asp are puzzling me...

CheckedIfTrue( b ) and SelectedIfSame(s, t) are called to precheck/select a radio button/checkbox or select list option depending upon the value or values passed to them. I've written similar functions myself in the past.

The strings returned are inserted into the HTML thus: checked="checked" and selected="selected" or simply an empty string (values not checked or selected).

Whilst this seems to work, all the HTML reference books I've seen state that these properties are not value/pairs like value="1" or class="redBox" but are stand alone properties, simply either "checked" or "selected" (without the quotes).

Please either correct me if this is the "new way" of doing things in the latest HTML standard or consider that there may be possible issues with FogBUGZ in future HTML releases.

Carl Revell
Friday, February 14, 2003

The attribute=value syntax for SELECTED is allowed in all versions of HTML; those versions just check for the attribute's presence, regardless of whether a value is also given.

It is -required- as of XHTML 1.0 (the successor to HTML 4); since XHTML is based on XML, any attribute must have a value specified.

David Thompson
Friday, February 14, 2003

*  Recent Topics

*  Fog Creek Home