On Mon, December 18, 2006 7:09 am, Nisse Engström wrote: > On Fri, 15 Dec 2006 23:22:13 -0600 (CST), "Richard Lynch" wrote: > >> $selected = $l == $limit ? 'selected="selected"' : ''; >> echo "<option value=\"$l\" $selected>$l</option>\n"; > > [snip] > >> The value="x" *is* optional, but you'll never convince the people >> who >> tell you it isn't, unless you force them to read the RFCs and W3C >> recommendations [*], so it's easier to include it than to argue with >> them. :-) > > It is indeed optional, and the HTML spec.[1] even says > that if the attribute is not set, the initial value is > set to the contents of the element. That's all good and > well. > > What's not all good and well are browser implementations. > If you try to retrieve the value from JavaScript (by way > of option.value or select.value) in IE 5.5 [2] and several > versions of Opera [3], you may find the value is simply > not there *unless* you spell it out in HTML. Ah. Yeah, now that I actually occasionally use JavaScript, I should actually pay attention to the "gotchas" of JS. :-) Thanks! -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php