I added a search form to my site however the validator keeps creating an error based on “input” typle at the start of the 2 inputs. The problem is I thought input areas were labelled.
Can anyone advise please what I should be using instead of input?
The FORM element really should have a FIELDSET and LEGEND or at the bare minimum a block-level element. Remember INPUT are inline elements. The FIELDSET is usually supposed to come directly after the start FORM tag.
Indeed, it doesn’t validate as XHTML strict.
The two lines containing the <input> elements throw the following error:
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"
What this means is that you can’t have the input element as a direct child of the form. They must be contained within one of “p”, “h1”, “h2”, “h3”, “h4”, “h5”, “h6”, “div”, “pre”, “address”, “fieldset”, “ins”, “del”.
As xhtmlcoder says you should probably put them in <fieldset> and <legend> tags.