Error in Form Document!

Help me fix this Error.

Page 1 of 1

1 Replies - 1599 Views - Last Post: 02 November 2009 - 11:22 AM

#1 JesusLover05   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-October 09

Error in Form Document!

Posted 02 November 2009 - 11:06 AM

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 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.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<!--Here is the head section I coded.-->
<title>Music Survey by Kelly Hadjiconstantinou</title>
<link rel="stylesheet" href="music.css" type="text/css" media="screen"  />
<!--Here is the body section I coded. -->
<!--Code for h1 heading-->
<h1>Music Survey</h1>
	  <!--Here is the code for the beginning of form.-->
<form method="get" action=""  />
	   <!--Here is the coding for the table-->
			 <!--Coding for name and email.-->
				 <td class="myLabel"><label for="myName">Name:</label>  
					<input type="text" name="myName" id="myName"  /></td>
				 <td class="myLabel"><label for="myEmail">E-mail: </label>
				 <input type="text" name="myEmail" id="myEmail"  /></td>
				  <!--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>
				 <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>      <input type="checkbox" name="rap" id="rap" 
					value="Yes" />Rap                               

				 <input type="checkbox" name="other" id="other" value="Yes"  />Other
				  <!--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
				 <!--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>
				<!--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>
				 <!--Code for submit and reset buttons-->
				 <td><br  />           <input type="submit" value="Submit"  

/>                <input type="reset" /></td>
<!--Code for e-mail address-->
<a href="mailto:[email protected]">[email protected]</a>

These are the errors I received when validating.

Line 73, Column 7: end tag for element "form" which is not open
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

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

This post has been edited by JesusLover05: 02 November 2009 - 11:07 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Error in Form Document!

#2 thehat   User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Error in Form Document!

Posted 02 November 2009 - 11:22 AM

Your form tag is written incorrectly. it has a /> at the end, when it should just be a >.
<form method="get" action=""  />

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: 02 November 2009 - 11:23 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1