Re: $POST Q
| From: | Jochem Maas | Date: | Mon, 18 Dec 2006 19:58:22 +0000 |
| Subject: | Re: $POST Q | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245968@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
> 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
^^--- LOOK EVERYONE - we have it in writing at last ;-)
> actually pay attention to the "gotchas" of JS.
I tend to classify them as 'wtf's and 'omg's but that's just the cynic in
me :-)
> :-)
>
> Thanks!
>