Re: $POST Q
| From: | Richard Lynch | Date: | Mon, 18 Dec 2006 19:48:15 +0000 |
| Subject: | Re: $POST Q | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245967@lists.php.net to get a copy of this message | ||
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?