On Thu, 2006-10-26 at 11:43 -0500, Richard Lynch wrote:
>
> $last_day = 31; //calculated from date()/mktime() etc
> for ($day = 1; $day <= $last_day; $day++){
> $selected = $chosen_day == $ ? 'selected="selected"' : '';
> echo " <option $selected>$day</option>\n";
> }
>
> I don't *think* the w3c requires/recommends a value= in there, if the
> label *IS* the value, but can live with it either way...
> echo " <option value=\"$day\" $selected>$day</option>\n";
> is fine.
>From the XHTML standard:
http://www.w3.org/TR/html/#diffs
We read the following:
XML does not support attribute minimization. Attribute-value pairs
must be written in full. Attribute names such as compact and checked
cannot occur in elements without their value being specified.
CORRECT: unminimized attributes
<dl compact="compact">
INCORRECT: minimized attributes
<dl compact>
So even if you aren't using XHTML yet, it's wise to get into the practice.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php