View Full Version : Xhtml Validation!
scriptkeeper
07-25-2003, 11:55 PM
Hello everyone! I was just validating a page and got some error not to many! But a couple that confuse me such as:
Line 142, column 10: character data is not allowed here
<option />0001.jpg
^
Can you not begin options text with a number in XHTML?
brothercake
07-26-2003, 12:01 AM
Is the code you posted there literally what you have in your page? Because you've closed the <option> and put the data outside it; you want
<option>xxx</option>
rather than
<option />xxx
btw - questions about XHTML really belong in HTML, unless the question is about XHTML as an XML application.
scriptkeeper
07-26-2003, 12:09 AM
Every time I validate the error list is different Somtimes it dosent like my select tags other times it does like my input tags. On tope of that the only image on the page it says has no name attribute and it does name="MainShow"! I am new to XHTML but if this is what I have to look forward to maybe I stick with HTML JK!
scriptkeeper
07-26-2003, 12:10 AM
Oh ok ill try that, Sorry about posting in the wrong place I asked my self the question where should I post this? I thought html then I seen the XHTML under XML forum so I posted here in the future I will post in the HTML Fourm!
brothercake
07-26-2003, 12:15 AM
Several things:
- never use comments to surround scripting - a parser is not required to read comments, and so there's no requirement to run that script; on an XHTML page served as XML, it won't work at all; of course if you take the comments out, then some legacy browsers print the literal text onto the page. So don't use inline javascript at all - take it out of the source code and put it in an external .js file. Same goes for the CSS - always use external files
- there's no such attribute as "bgcolor" in XHTML strict
- there's no such tag as <center>
- your <form> has no "action" attribute
- your <option/> have the problem I mentioned before - the end-slash is for closing empty elements, but <option> is not an empty element; not in this case anyway:
<option>Pic_One</option>
not
<option />Pic_One
brothercake
07-26-2003, 12:19 AM
Originally posted by scriptkeeper
then I seen the XHTML under XML forum so I posted here
Yeah that possibly needs changing - when CF started, XHTML was new to most people (apart from jkd and Alex, and a few others ;)) so maybe it seemed more appropriate to categorise it as part of XML; but in practise most questions about XHTML are not about XML per se.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.