|
Posted by cwdjrxyz on 10/14/06 00:36
Arjen wrote:
> Hi, this piece of html doesn;t validate. That w3c validator sais
> something about block elements in inline elements. As I understand it
> <p><form></form></p> is valid or am I wrong ?
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title>test</title>
> </head>
> <body>
> <div id = "testx">
> <p>
> text<br />
> <form action="index.php" method="post">
> veld:<br />
> <input type="text" name="field" id="field"><br \>
> <input type="submit" id="submitid" value="Submit" />
> </form>
> </p>
> </div>
> </body>
> </html>
I will leave it to others to explain in detail why your form had
validation problems - there were several error messages in fact.
However see http://www.cwdjr.info/test/formtest.html for a modified
version of your test page that does validate at W3C as xhtml 1.0
strict. You may need to reformat it a bit to display exactly as you
wish on the page. Note that the validator is much more strict for a
xhtml page than a html 4.01 strict page, and you often can get away
with much more in html without validator error messages. Are you
actually planning to serve the page as true xhtml, with your server set
up with perhaps .xhtml associated with the mime type
application/xhtml+xml ? If you just serve it as usual with the html
extension, your page just gets served as text/html normal html despite
the xhtml Doctype. But if you do serve as true xhtml with the mentioned
mime type, IE6 will not view true xhtml. This would require a separate
html 4.01 strict page for IE6 and a convenient method for selecting it
when needed. This would require some server side code such as php or
something else to modify the code or redirect to another page when an
html page is needed for IE6 and some early browsers.
Note that my example page is being served as .html because that is how
I assumed you wished to do it because of the your extension .html
rather than .xtml or .xml. Doing it this way, you might as well write
the page as html 4.01 strict because the page is only going to be
served as html - not xhtml or xml - anyway.
Navigation:
[Reply to this message]
|