Jump to content

XHTML Strict problems


Natechs

Recommended Posts

I validated all my pages from my site but the "Services" page doesn't check out because of the form and I don't understand why. Help!CURRENT CODE:

<?xml version="1.0" encoding="utf-8"?><!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"><head><meta name="author" content="Nathan Chancellor" /><meta name="keywords" content="web designer, nathan c, nathan's services, nathan's web design services" /><meta name="description" content="Nathan C, a somewhat talented web designer, runs this site as a service and personal website" /><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="styles.css" /><title>Nathan C:: Services</title></head><body><div id="banner"><img src="images/services.gif" alt="Services banner" /></div><hr /><div id="navBar"><br /><ul><li><a href="index.html" class="list">Home</a></li><li><a href="aboutme.html" class="list">About Me</a></li><li><a href="projects.html" class="list">Projects</a></li><li><a href="services.html" class="list">Services</a></li><li><a href="news.html" class="list">News</a></li><li><a href="http://ncwebdesign.getphpbb.com/" class="list">Forum</a></li></ul></div><div id="content"><div class="main"><h2 class="center">Services</h2><p>My going rate is currently free but will become $5 a page.</p></div><p>Please fill out this form for your free page:</p><form action="MAILTO:natecdog@gmail.com" method="post" enctype="text/plain"><p>Name:</p><input type="text" name="name" value="" /> <p>Email address:</p><input type="text" name="email" value="" /> <p>What do you want the background-color to be?</p><input type="text" name="bgcolor" value="" /><p>Font color?</p><input type="text" name="fcolor" value="" /><p>Fonts?</p><input type="text" name="fonts" value="" /><p>What is your page title?</p><input type="text" name="title" value="" /><p>Images? (provide the URLs)</p><input type="text" name="images" value=""/><p>Provide any other info:</p><input type="text" name="otherinfo" value="" /><input type="submit" value="Submit my Request" /><input type="reset" value="Reset" /></form><p>I strive to reply to inquires within one business day. If youhave not heard back from me, please send me an e-mail atnatecdog@gmail.com.</p><p>Here are some pre made templates:</p><a href="darksand.zip">Dark Sand</a><br /><a href="grayandblue.zip">Gray and Blue</a><br /><a href="wheat.zip">Wheat</a><br /></div><div id="footer">© 2008 Nathan C | <a href="mailto:natecdog@gmail.com">contact me</a> | <a href="http://www.geocities.com/bioniclepages">BioniclePages</a> | <a href="http://validator.w3.org/check?uri=referer">XHTML 1.0</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS 2.1</a> | <script type="text/javascript">//<![CDATA[      <!--      document.write("Document updated: " + document.lastModified);      //-->//]]></script></div></body></html>

Link to comment
Share on other sites

Most likely it's because you put text and inline elements directly under the <form> element. Try putting it within a <p> elements or a <div> element:

<form><div>Everything else here</div></form>

Link to comment
Share on other sites

You misunderstood.I mean to put everything within the div tags:<form><div>Name: <input>More information <input>Something else: <input></div></form>

Link to comment
Share on other sites

Guest FirefoxRocks

As an extra note, I recommend using the <fieldset> element as a block for forms. It defines a section in a form, and most likely your form is 1 section unless it has a lot of different parts to it.

Link to comment
Share on other sites

Also, you can't have script tags in the body of the document in XHTML Strict. Move it to the head and make it write to an element's innerHTML onload.

Link to comment
Share on other sites

Also, you can't have script tags in the body of the document in XHTML Strict. Move it to the head and make it write to an element's innerHTML onload.
Liar!!!OK, kidding, but... you're wrong. You can have script tags in the body, and infact, if you have all of your scripts at the bottom, right before the closing body tag, your page will render faster. At the same time, you have access to all of the page's DOM. Makes me wonder why on earth don't people do that more often.
Link to comment
Share on other sites

:) you are right! Now why did I think that... :) I'm sure the validator has complained about script tags in the body before...http://www.roundeddesign.com/validation_test.html
Makes me wonder why on earth don't people do that more often.
I suppose it's something to do with separating the structure from the scripts... or they also thought it was wrong to put script tags in the body :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...