Validation Problem :-)

Frank-designer

New Member
Hi everyone,

I have been trying for hours but I cant get this part of my code to validate :confused: Can anyone help?

Code:
<form action="/index.php" method="get">
    <input type="image" src="img/nav/next.gif" alt="[ Next Page ]"
    title="[ Next Page ]" name="id" value="28" />
</form>

W3C [External] said:
Error Line 37, Column 119: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

…Next Page ]" name="id" value="28" /></form>
 
Last edited:

adx

New Member
This usually means that you've forgot to close an element. Just check the page for an open paragraph tag or something, I don't think it should be any more difficult.
 

Frank-designer

New Member
This usually means that you've forgot to close an element. Just check the page for an open paragraph tag or something, I don't think it should be any more difficult.

Thanks for the advice but all tags are closed though out the document. When I remove the <input ... / > tag then the page validates. Has it anything to do with me using an image as a submit button? :confused:
 

horrorshow75

New Member
Can you post the link so we can look at what the validator has to say? I know you quoted the validator but sometimes it's easier to find the issue when actually looking at it.
 

DonEl

New Member
Change document type

If you change your dtd to Transitional it passes.


http://validator.w3.org/check?uri=http://picreative.co.uk/christest/index.php

that address is your validation when I forced it as transitional. Strict is just that...strict. The only thing stricter is 1.1. I couldn't tell you why it won't pass as strict. It follows the rules and you don't use deprecated tags. The validator seems pretty positive your input tag needs to be contained. If you require the strict DTD, though, let's figure this out. Throw a paragraph around it just to see what happens.
UPDATE: I just looked in another forum and in strict, input is an inline element and must be contained. Use <p> or <div> or <table> tags to contain it and it will pass. The person in the other forum had the same problem and this fixed it. Here's a link to the forum ?
http://www.codingforums.com/showthread.php?t=42244
 
Last edited:
Top