Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vaidation error correction

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
0
0
GB
Hi all

Would appreciate help in resolving the reported error from the W3C Markup Validation Service.

The code is:-
Code:
<select title="View Selected or All Makes" onchange="location = this.options[this.selectedIndex].value;">
The reported error is:-
Code:
Line 64, Column 115: document type does not allow element "select" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

…ed or All Makes" onchange="location = this.options[this.selectedIndex].value;">

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
TIA


FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Is it within a form?

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Depending on your doctype it may or may not be allowed to have form elements which are inline elements exist by themselves. They need a block level element around them to hold them.

That is why it suggests you use a <p> or <div> etc...
Simply but the strict doctypes don't allow inline elements to just be there.

Being inside a form on the other hand is not a requirement.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top