View Full Version : XHTML <form> and <input> usage


steventaylor
07-05-2012, 12:06 PM
Greetings,

For a textbook, there is a search page towards the end containing a text field which is getting flagged:


<form action="" method="get">
<div>
<input name="q" type="text" value="" /> <input type="submit" value="search" /> <span class="sgc-2" id="search-progress"></span>
</div>
</form>


There are 4 errors within ePubCheck 1.2 from the above code:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

Epubcheck Version 1.2

ERROR: C:\file.epub/OEBPS/Text/search.html(308): element "form" not allowed anywhere; e
xpected the element end-tag, text or element "a", "abbr", "acronym", "address",
"applet", "b", "bdo", "big", "blockquote", "br", "cite", "code", "del", "dfn", "
div", "dl", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img"
, "ins", "kbd", "map", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "s
amp", "script", "small", "span", "strong", "sub", "sup", "table", "tt", "ul" or
"var" (with xmlns:ns="http://www.w3.org/2000/svg")

ERROR: C:\file.epub/OEBPS/Text/search.html(310): element "input" not allowed anywhere;
expected text or element "a", "abbr", "acronym", "address", "applet", "b", "bdo"
, "big", "blockquote", "br", "cite", "code", "del", "dfn", "div", "dl", "em", "h
1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img", "ins", "kbd", "map
", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "samp", "script", "sma
ll", "span", "strong", "sub", "sup", "table", "tt", "ul" or "var" (with xmlns:ns
="http://www.w3.org/2000/svg")

ERROR: C:\file.epub/OEBPS/Text/search.html(310): element "input" not allowed anywhere;
expected text or element "a", "abbr", "acronym", "address", "applet", "b", "bdo"
, "big", "blockquote", "br", "cite", "code", "del", "dfn", "div", "dl", "em", "h
1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img", "ins", "kbd", "map
", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "samp", "script", "sma
ll", "span", "strong", "sub", "sup", "table", "tt", "ul" or "var" (with xmlns:ns
="http://www.w3.org/2000/svg")

ERROR: C:\file.epub/OEBPS/Text/search.html(311): element "input" not allowed anywhere;
expected text or element "a", "abbr", "acronym", "address", "applet", "b", "bdo"
, "big", "blockquote", "br", "cite", "code", "del", "dfn", "div", "dl", "em", "h
1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img", "ins", "kbd", "map
", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "samp", "script", "sma
ll", "span", "strong", "sub", "sup", "table", "tt", "ul" or "var" (with xmlns:ns
="http://www.w3.org/2000/svg")

Check finished with warnings or errors!


According to w3schools, the <form> element isn't allowed in XHTML; however even after taking out the <form> element and leaving <input> the last two errors above still appear, even with <div> or <p> tags surrounding it. Any help is appreciated!!

mmat1
07-05-2012, 12:42 PM
For a textbook, there is a search page towards the end containing a text field which is getting flagged:


To bring is straight to the point: <form> and <input> in epub 2.1: no way ! sorry.

The forms-module is a among the required modules, see here (http://idpf.org/epub/20/spec/OPS_2.0.1_draft.htm#TOC2.2.1)

DaleDe
07-09-2012, 11:54 AM
To bring is straight to the point: <form> and <input> in epub 2.1: no way ! sorry.

The forms-module is a among the required modules, see here (http://idpf.org/epub/20/spec/OPS_2.0.1_draft.htm#TOC2.2.1)

I think you meant the forms-module is not among the required modules. Not only is it not required it is not allowed.

mmat1
07-09-2012, 12:44 PM
I think you meant the forms-module is not among the required modules. Not only is it not required it is not allowed.

Sorry for the typo. Of course the "a" should be "not".

But not allowed ? Did I condone something ??

DaleDe
07-09-2012, 08:51 PM
Sorry for the typo. Of course the "a" should be "not".

But not allowed ? Did I condone something ??

Not condone, I wasn't referring to condoning something, specs don't usually use that term. There are some things that are optional in the spec, that is not required. The reading app can ignore them if desired. Things that are required cannot be ignored by the reading app.