XHTML Strict Form - Here is the code.

Discussion in 'HTML & Website Design' started by Matt Ridge, Sep 20, 2011.

  1. #1
    After some trial, error and a bunch of bloody headaches cured only by sleep and aspirin, I figured out how to create a form that is XHTML Strict. At least by the W3 Validator. Before I start using this and going nuts using it, I want to validate it here...

    Now mind you every label and input has an identifier for the sole purpose of being able to move around both anywhere on the page via CSS...

    Yes I know that there is HTML5, and it is the latest and greatest thing out there, but as I've said before, XHTML is the Windows XP of the PC world. It's old, it's solid and it works... HTML 5 is the Windows 7 of the world. It is gaining momentum, but it's not taken over the XP world yet... so for now I am still going to write in XHTML till open source groups start using it as a standard... which right now is slow to happen.

    So in leu of my rant, I now present an XHTML Strict Form. It only has one field, but you can do what you want after the fact. Now remember, you need to save this script with Encoding in UTF-8 without BOM to pass 100%. My suggestion is using Notepad++ for Windows, or if you are on a Mac TextWrangler to make it work correctly.

    <!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 http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Your Form</title>
    <link rel="stylesheet" type="text/css" href="Your_CSS_Here.css" />
    </head>
    <body>
    
    
    <form action ="Your_Database.php" method="post">
    <fieldset>
       <div id ="ab"> 
             <label id="ab1">Added By:</label>
                 <input id="ab2" type="text" name="Added_By" value="" />
       </div>
    </fieldset> 
    </form>
    </body>
    </html>
    
    Code (markup):
     
    Last edited: Sep 20, 2011
    Matt Ridge, Sep 20, 2011 IP