Re: Still trying to figure this out...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 5:48 PM -0400 6/19/06, Jon Anderson wrote:
>John Nichel wrote:
>>Pfffftttt  I never close my option tags that way....
>>
>><option value="foo" />Bar
>>
>>:-p
>>
>I didn't think this would compute as proper XHTML...Sure enough validator.w3c.org says:
>
>Error /Line 10 column 10/: character data is not allowed here.
>
>|<option />*t*est|
>
>You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).

It depends upon what DOCTYPE you use.

For example, if you use:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd";>

There's nothing wrong with closing, or not closing, an option tag in just about any fashion you want. In fact all four below will validate:

<option value="123" > item

<option value="123" /> item

<option value="123"> item </option>

<option value="123"/> item </option>

As far as using "value=", I believe the DOCTYPE determines what tags are allowed what attributes.

As for XHTML, I find that an unusual bird for validation and getting things to work well.

tedd

-- 
------------------------------------------------------------------------------------
http://sperling.com  http://ancientstones.com  http://earthstones.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux