HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 30th, 2012, 12:20 PM
EEsterling EEsterling is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 97 EEsterling User rank is Sergeant Major (2000 - 5000 Reputation Level)EEsterling User rank is Sergeant Major (2000 - 5000 Reputation Level)EEsterling User rank is Sergeant Major (2000 - 5000 Reputation Level)EEsterling User rank is Sergeant Major (2000 - 5000 Reputation Level)EEsterling User rank is Sergeant Major (2000 - 5000 Reputation Level)EEsterling User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 18 h 28 m 56 sec
Reputation Power: 49
Form overlaps divs, but that's not valid

I have a page where the structure is basically:
Code:
<div><form></div><div></form><form></form></div>

Basically, there's a big form that starts in the left column and ends in the right column, then a second form in the right column.

The problem is, that isn't valid. The end of the first div says "close the stuff in here, including the form."

On the other hand, although it isn't valid the page does work on all browsers I tested. So, option one is ignore the lack of validation.

If I didn't have the second form, I would wrap both divs in the form. That would solve my problem. But I do, so that's not an option.

The forms are the gist of the page. The divs are just there for layout. The first form is big and needs two columns. The second form is small and fits nicely in the second column.

Option two: Another change which validates is basically:
Code:
<form><div id="left"></div><div id="right"></div><div id="right2"><form></form></div> 

But that gives me another thing to manage in my layout.

What would you do? Another option?

I've put a complete example below if you want to play.

Code:
<!DOCTYPE html>
<html>
<head>
  <title>A Form Overlapping Columns</title>
  <style type="text/css">
    #leftcolumn { float:left; width:15em }
    #rightcolumn { margin-left:16em }
  </style>
</head>
<body>
<h1>A Form Overlapping Columns</h1>
<p>This page works on browsers, but fails validation.</p>
<p>One form begins in the first div/column, ends in the second.  The other is a small form in the second column.</p>

<div id="leftcolumn">
  <form name="BigForm" action="#">
    <p>Q1: <input type="text" /><br />
    Q2: <input type="text" /><br />
    Q3: <input type="text" /></p>
</div>
<div id="rightcolumn">
    <p>  One last question: <input type="text" /><br />
    <button type="submit">Submit Big</button></p>
  </form>
  <form name="LittleForm" action="#">
    <p>A different question: <input type="text" /><br />
    <button type="submit">Submit Little</button></p>
  </form>
</div>

</body>
</html>

Obviously, there are things missing like attributes on the forms and inputs and I always use label tags. But in the interest of brevity, they are left out for the example.

Doctype HTML5 and XHTML 1 have the same issue.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Form overlaps divs, but that's not valid

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap