Re: Still trying to figure this out...

From: Date: Mon, 19 Jun 2006 22:24:40 +0000
Subject: Re: Still trying to figure this out...
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-238333@lists.php.net to get a copy of this message
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

« previous php.general (#238333) next »