Jump to content
php.lv forumi

Validate HTML neizprotama kļūme


Wuu

Recommended Posts

Line 24, Column 54: 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

 

<input id="chatbox" name="chatbox" type="text" />

 

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>").

 

<form id="chat_submit" action="self" onsubmit="send_chat(); return false;">
<input id="chatbox" name="chatbox" type="text" />
</form>

 

Kā to izlabot?

Link to comment
Share on other sites

Tas ir tikai XHTML Strict. XHTML Transitional pieļauj arī inline elementus pa taisno "form" elementa cdata iekšā. Varētu būt saistīts ar sekojošām definīcijām (neesmu baigais DTD specs, tāpēc 100% visu tur nezinu):

 

No XHTML 1.0 Strict DTD:

<!ENTITY % form.content "(%block; | %misc;)*">

 

No XHTML 1.0 Transtional DTD:

<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*">

 

Izskatās, ka Transitional versija pieļauj inline, kamēr Strict nē.

Edited by Web Developer
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...