View Single Post
Old 06-10-2009, 07:09 PM   #1 (permalink)
Arminius
Registered User
 
Join Date: Feb 2009
Posts: 5
OS: Vista


Fieldset or Span?

I am creating a form maker with HTML and JavaScript. I am splitting the form areas using an unordered list. Like so.

HTML Code:
<form>
		<ul>
			<li>
				<label for="first">Name: </label>
				<input type="text" name="first" id="first" value="" maxlength=""/> 
				<label for="first">First</label>
				<input type="text" name="last" id="last" value="" maxlength=""/>
				<label for="last">Last</label>
			</li>
		</ul>
	</form>
Fine?



However they need to be separated to provide the result I want. So should I use a span or fieldset? Here is an example...

HTML Code:
<form>
	<ul>
		<li>
			<span>
				<label for="first">Name: </label>
			</span>
			<span>
				<input type="text" name="first" id="first" value="" maxlength=""/> 
				<label for="first">First</label>
			</span>
			<span>
				<input type="text" name="last" id="last" value="" maxlength=""/>
				<label for="last">Last</label>
			</span>
		</li>
	</ul>
</form>

This is what I want...
HTML Code:
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Untitled Document</title>
		
		<style>
			li{
				list-style:none;
			}
			li span{
				float:left;
				margin: 0 5px 0 0;
			}
			label{
				clear:both;
				display:block;
				margin:0;
			}
			input[type="text"]**
				margin:0;
				center top;
			}
		</style>
		
	</head>
	<body>
		<form>
			<ul>
				<li>
					<span>
						<label for="first">Name: </label>
					</span>
					<span>
						<input type="text" name="first" id="first" value="" maxlength=""/> 
						<label for="first">First</label>
					</span>
					<span>
						<input type="text" name="last" id="last" value="" maxlength=""/>
						<label for="last">Last</label>
					</span>
				</li>
			</ul>
		</form>
	</body>

I do not know if there are any advantages or disadvantages when it comes to search engines etc... What is the best way to code this? Is there a way to do this without separating it? Is doing this with a list good? etc..
Arminius is offline   Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here