webForumDet fria alternativet

xhtml validering

2 svar · 382 visningar · startad av Jeppeweb

JeppewebMedlem sedan sep. 2006462 inlägg
#1
     <form id="startsearch" method="get" action="">
     <input type="text" value="Sök..." onclick="if(this.value == 'Sök...'){ this.value=''; }"/>
     </form>

Varför validerar inte den koden?

Line 95, Column 94: 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.
…alue == 'Sök...'){ this.value=''; }"/>&#9993; 
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>").
FiaMedlem sedan apr. 20042 994 inlägg
#2

Den vill nog ha <fieldset>-taggar mellan <form>-taggarna och <input>-taggarna.

JeppewebMedlem sedan sep. 2006462 inlägg
#3

Tack!

127 ms totalt · 3 externa anrop · v20260731065814-full.0e50b1ef
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
124 ms — hämta tråd, inlägg och bilagor (db)