Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Apr 2011
    Posts
    107
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Why do i get a HTML error in my validator?

    Basically i have used tables and used form tags to put everything in. why do i get a error saying "end tag for element form which is not opened" but it is opened? any help will be appreciated.

    HTML CODE
    Code:
    <table id="tb1">
    <tr>
    <td><p class="LOC">Location:</p></td>
    <td><div id="LC">
    <form action="insert.php" method="post">
    <select multiple="multiple" size="5" style="width: 150px;" >
    <option>Armley</option>
    <option>Chapel Allerton</option>
    <option>Harehills</option>
    <option>Headingley</option>
    <option>Hyde Park</option>
    <option>Moortown</option>
    <option>Roundhay</option>
    </select>
    </div>
    </td><td><p class="PT">Property type:</p></td>
    	<td><div id="PS">
    		
    		<select name="property type" style="width: 170px;">
    		<option value="none" selected="selected">Any</option>
    		<option value="Houses">Houses</option>
    		<option value="Flats / Apartments">Flats / Apartments</option>
    		</select>
    	</div>
    	</td><td>
    	<div id="ptype">
    	 
    <input type="radio" class="styled" name="ptype" value="forsale"/> For Sale 
    
    <p class="increase">
    <input type="radio" class="styled" name="ptype" value="forrent"/> To Rent
    </p>
    <p class="increase">
    <input type="radio" class="styled" name="ptype" value="any"/> Any
    </p>
    
    	</div>
    	</td>
    </tr>
    		
    		</table>
    		
    		<div id="table2">
    		<table id="NBtable">
    		<tr>
    		<td><p class="NBS">Number of bedrooms:</p></td>
    		<td><div id="NB">
    		
    		<select name="number of bedrooms">
    		<option value="none" selected="selected">No Min</option>
    		<option value="1">1</option>
    		<option value="2">2</option>
    		<option value="3">3</option>
    		<option value="4">4</option>
    		<option value="5">5</option>
    		</select> to
    		
    		<select name="number of bedrooms">
    		<option value="none" selected="selected">No Max</option>
    		<option value="1">1</option>
    		<option value="2">2</option>
    		<option value="3">3</option>
    		<option value="4">4</option>
    		<option value="5">5</option>
    		</select>	
    		</div>
    	</td>
    	
    		<td><p class="PR">Price range:</p></td>
    		<td><div id="PR">
    		
    		<select name="price range">
    		<option value="none" selected="selected">No Min</option>
    		<option value="50,000">50,000</option>
    		<option value="60,000">60,000</option>
    		<option value="70,000">70,000</option>
    		<option value="80,000">80,000</option>
    		<option value="90,000">90,000</option>
    		<option value="100,000">100,000</option>
    		<option value="110,000">110,000</option>
    		<option value="120,000">120,000</option>
    		<option value="130,000">130,000</option>
    		<option value="140,000">140,000</option>
    		<option value="150,000">150,000</option>
    		<option value="160,000">160,000</option>
    		<option value="170,000">170,000</option>
    		<option value="180,000">180,000</option>
    		<option value="190,000">190,000</option>
    		<option value="200,000">200,000</option>
    		<option value="210,000">210,000</option>
    		<option value="220,000">220,000</option>
    		<option value="230,000">230,000</option>
    		<option value="240,000">240,000</option>
    		<option value="250,000">250,000</option>
    		<option value="260,000">260,000</option>
    		<option value="270,000">270,000</option>
    		<option value="280,000">280,000</option>
    		<option value="290,000">290,000</option>
    		<option value="300,000">300,000</option>
    		<option value="310,000">310,000</option>
    		<option value="320,000">320,000</option>
    		<option value="330,000">330,000</option>
    		<option value="340,000">340,000</option>
    		<option value="350,000">350,000</option>
    		</select> to
    		
    		<select name="price range">
    		<option value="none" selected="selected">No Max</option>
    		<option value="50,000">50,000</option>
    		<option value="60,000">60,000</option>
    		<option value="70,000">70,000</option>
    		<option value="80,000">80,000</option>
    		<option value="90,000">90,000</option>
    		<option value="100,000">100,000</option>
    		<option value="110,000">110,000</option>
    		<option value="120,000">120,000</option>
    		<option value="130,000">130,000</option>
    		<option value="140,000">140,000</option>
    		<option value="150,000">150,000</option>
    		<option value="160,000">160,000</option>
    		<option value="170,000">170,000</option>
    		<option value="180,000">180,000</option>
    		<option value="190,000">190,000</option>
    		<option value="200,000">200,000</option>
    		<option value="210,000">210,000</option>
    		<option value="220,000">220,000</option>
    		<option value="230,000">230,000</option>
    		<option value="240,000">240,000</option>
    		<option value="250,000">250,000</option>
    		<option value="260,000">260,000</option>
    		<option value="270,000">270,000</option>
    		<option value="280,000">280,000</option>
    		<option value="290,000">290,000</option>
    		<option value="300,000">300,000</option>
    		<option value="310,000">310,000</option>
    		<option value="320,000">320,000</option>
    		<option value="330,000">330,000</option>
    		<option value="340,000">340,000</option>
    		<option value="350,000">350,000</option>
    
    		</select>
    	
    		</div>
    	</td>
    </tr>
    		
    		</table>
    		
    		<input type="submit" value="submit" />
    	     </form>	
    		
    		</div>

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    You open your form element in a different <td> than the one you have your closing </form> tag entered into. This will cause problems.

    My recommendation would be to put the opening and closing form tags OUTSIDE of the table entirely. This will avert your next minor disaster, which is that you have entered <select> and <input> elements inside of the form without a containing element (such as a table or a div).
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • Users who have thanked Rowsdower! for this post:

    shakoor6 (03-09-2012)

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    It'll more than likely be the form tag. Move the form tags outside of the tables.

    Code:
    <form action="insert.php" method="post">
    <table id="tb1">
    Code:
    </div>
    </form>

  • Users who have thanked Nightfire for this post:

    shakoor6 (03-09-2012)

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    You open your form after you open your table, but close the form AFTER you close the table.

    You have improperly nested some elements.....
    Thats a hint...lol
    Teed

  • Users who have thanked teedoff for this post:

    shakoor6 (03-09-2012)

  • #5
    Regular Coder
    Join Date
    Apr 2011
    Posts
    107
    Thanks
    18
    Thanked 0 Times in 0 Posts
    U guys are brilliant! thanx alot!

  • #6
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by Nightfire View Post
    It'll more than likely be the form tag. Move the form tags outside of the tables.

    Code:
    <form action="insert.php" method="post">
    <table id="tb1">
    Code:
    </div>
    </form>
    lol oops nightfire already beat me to it.
    Teed

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    In most cases a form isn't tabular data and so shouldn't be using a table.

    Using a table interferes with some of the tags in the form - such as being able to wrap a fieldset around a group of radio buttons to group them together visually.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •