Click to See Complete Forum and Search --> : Neat and tidy HTML forms


mastreblig
10-26-2006, 04:42 AM
How do I get the text boxes to line up nice and neat and possibly be of the same length?

:confused:

<p><h1><b>Fleet Insurance Quote</b></h1></p>

<form action="fleetquote.php" method="post">
<p>Full Name: <input type="text" name="name" size="40"></p>

<p>Business Name: <input type="text" name="businessname" size="40"></p>

<p>Business Address: <textarea name="businessaddress"></textarea>

<p>Email Address: <input type="text" name="email"></p>

<p>Home Phone: <input type="text" name="home phone"></p>

<p>Mobile Phone: <input type="text" name="mobile phone"></p>

<p>When does your existing cover expire?: <textarea name="coverexpires"></textarea>

<p>Existing Insurer: <input type="text" name="existing_insurer"></p>

<p>Current Premium (£): <input type="text" name="current_premium"></p>

<p>No. of vehicles: <SELECT NAME="no.of_vehicles" SIZE="1">
<OPTION SELECTED>Please Select
<OPTION>1
<OPTION>2
<OPTION>3
<OPTION>4
<OPTION>5
<OPTION>6
<OPTION>7
<OPTION>8
<OPTION>9
<OPTION>10-25
<OPTION>26-50
<OPTION>51+
</SELECT></p>

<p>Drivers: <SELECT NAME="drivers" SIZE="1">
<OPTION SELECTED>Please Select
<OPTION>Insured & Named Policy
<OPTION>Any Driver 25+
</SELECT></p>

<p>How did you find us?: <SELECT NAME="lead_source" SIZE="1">
<OPTION SELECTED>Please Select
<OPTION>Yahoo
<OPTION>MSN
<OPTION>Lycos
<OPTION>MySpace
<OPTION>Google
<OPTION>Other
</SELECT></p>

<input type="submit" name="submit" value="Submit Form">
</form></p>

abz
10-26-2006, 06:02 AM
make all your tags lowercse, and close all your option tags:

<option>Lycos</option>
<option>MySpace</option>


also make sure the attributes have values. eg <option selected="selected">

Can you paste your whole page code, or a link to the site. Would help to be able to see everything.

edit: also <p><h1><b>Fleet Insurance Quote</b></h1></p> if something is a heading, it cant be a paragraph too! And you can't have a paragraph inside another paragraph.

mastreblig
10-26-2006, 09:21 AM
The boxes haven't lined up nice and straight!

http://www.dna-insurance.com/article.php?aid=29

NogDog
10-26-2006, 09:38 AM
make all your tags lowercse, and close all your option tags:


also make sure the attributes have values. eg <option selected="selected">
...
None of that is required for HTML, only for XHTML.

NogDog
10-26-2006, 09:41 AM
The boxes haven't lined up nice and straight!

http://www.dna-insurance.com/article.php?aid=29
You basically have two choices: (1) use CSS styling (see the CSS forum, above), or (2) use a 2-column table to contain the labels and fields.

You can get the text fields to all be the same length by giving them the same "size" attribute, then using the "maxlength" attribute to control the maximum number of characters allowed.

mastreblig
10-27-2006, 06:13 AM
Can u show me an example of how that'd be used?

Cheers.

Dann0
10-27-2006, 08:43 AM
here is a quick "example" of what I think you want. I used your form. I also did not hide the table/cells (although you will want to) so you can get an idea of how I set it up. Please keep in mind, I am no pro at HTML, this is just an example of how I would lay out this form. I hope it helps.
http://www.ospl.ca/quote.html

mastreblig
10-27-2006, 10:14 AM
Brilliant, cheers Dann0