School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,138 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,788 people online right now. Registration is fast and FREE... Join Now!




Error in Form Document!

 

Error in Form Document!, Help me fix this Error.

JesusLover05

2 Nov, 2009 - 10:06 AM
Post #1

New D.I.C Head
*

Joined: 10 Oct, 2009
Posts: 13

Hey Everyone,

I did xhtml for a music survey form and my page is not validating properly. All the elements are correct but it still will not validate at w3.org/validator. Please help me fix what needs to be changed in order for my page to validate. Thank you and God bless. Here is my code.

CODE
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--Here is the head section I coded.-->
<head>
<title>Music Survey by Kelly Hadjiconstantinou</title>
<link rel="stylesheet" href="music.css" type="text/css" media="screen"  />
</head>
<!--Here is the body section I coded. -->
<body>
<!--Code for h1 heading-->
<h1>Music Survey</h1>
      <!--Here is the code for the beginning of form.-->
<form method="get" action="http://www28.brinkster.com/cs2413/formHandler.asp"  />
       <!--Here is the coding for the table-->
        <table>
             <!--Coding for name and email.-->
             <tr>
                 <td class="myLabel"><label for="myName">Name:</label>  
                    <input type="text" name="myName" id="myName"  /></td>
             </tr>
             <tr>
                 <td class="myLabel"><label for="myEmail">E-mail: </label>
                 <input type="text" name="myEmail" id="myEmail"  /></td>
            </tr>
            <tr>
                  <!--Coding for "Select Your Favorite Types of Music" group-->
                 <td><h3><br  />Select Your Favorite Types of Music:</h3>    
                 <input type="checkbox" name="pop" id="pop" value="Yes"  />Pop                  

                                 
                 <input type="checkbox" name="classial" id="classical" value="Yes" />Classical</td>
             </tr>
             <tr>
                 <td align="left" colspan="2">    
                 <input type="checkbox" name="roc" id="roc" value="Yes"  />Rock                 

                                
                 <input type="checkbox" name="fol" id="fol" value="Yes"  />Folk<br  />
                 </td>
            </tr>
            <tr>
                 <td>      <input type="checkbox" name="rap" id="rap"
                    value="Yes" />Rap                              

                     
                 <input type="checkbox" name="other" id="other" value="Yes"  />Other
                </td>
             </tr>
             <tr>
                  <!--Code for "Purchase CDs" group-->
                 <td><h3><br  />Select how often you purchase music CDs:</h3>      
                 <input type="radio" name="Purhase" id="pw" value="Weekly" checked="checked"  />Weekly           

                                        

                 <input type="radio" name="Purhase" id="pafcdey" value="A  few CDs each year"  />A few Cds each year<br  />     
                 <input type="radio" name="Purchase" id="pm" value="Monthly"  />Monthly               

                             
                 <input type="radio" name="Purchase" id="pnp" value="Never Purchase"  />Never Purchase
                 </td>
             </tr>
             <tr>
                 <!--Code for "Locations group-->
                 <td><h3><br  />Select the locations you listen to CDs:</h3>         
                    <select size="3" name="location" id="location">
                       <option selected="selected">Select one or more locations</option>
                       <option value="At home">At home</option>
                       <option value="In the car">In the car</option>
                       <option value="Music store">Music store</option>
                    </select></td>
             </tr>
             <tr>
                <!--Code for "Music Question" group-->
                 <td><h3><br  />What role does music play in your life?</h3>          
                 <textarea name="myComment" id="myComment" cols="60" rows="3"></textarea></td>
             </tr>
             <tr>
                 <!--Code for submit and reset buttons-->
                 <td><br  />           <input type="submit" value="Submit"  

/>                <input type="reset" /></td>
             </tr>
      </table>
</form>
<!--Code for e-mail address-->
<a href="mailto:kellyis4jc@msn.com">kellsyis4jc@msn.com</a>
</body>
</html>


These are the errors I received when validating.

Line 73, Column 7: end tag for element "form" which is not open
</form>✉
The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
If this error occurred in a script section of your document, you should probably read this FAQ entry.

Line 73, Column 7: XML Parsing Error: Opening and ending tag mismatch: body line 11 and form
</form>✉

Line 76, Column 7: XML Parsing Error: Opening and ending tag mismatch: html line 4 and body
</body>


This post has been edited by JesusLover05: 2 Nov, 2009 - 10:07 AM

User is offlineProfile CardPM
+Quote Post


thehat

RE: Error In Form Document!

2 Nov, 2009 - 10:22 AM
Post #2

awake ? web();
Group Icon

Joined: 28 Feb, 2008
Posts: 940



Thanked: 99 times
Dream Kudos: 200
My Contributions
Your form tag is written incorrectly. it has a /> at the end, when it should just be a >.
CODE

<form method="get" action="http://www28.brinkster.com/cs2413/formHandler.asp"  />

Only end a tag with /> when it does not contain anything, like a line break: <br />

Also, you have two doctype declarations, one for xml and one for xhtml. Get rid of the xml one.

This post has been edited by thehat: 2 Nov, 2009 - 10:23 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:24PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month