Web Form

Reply

Join Date: Apr 2007
Posts: 34
Reputation: pbrookee is an unknown quantity at this point 
Solved Threads: 0
pbrookee pbrookee is offline Offline
Light Poster

Web Form

 
0
  #1
Jun 6th, 2007
Hello all!
I created a web form, but it isnt I guess to say attractive?
Its a form to enter some information, but the alignment is horrible lookg. Can any one help me?

Thanks!!!!!!!!!

Here is the code...

<html>
<head>
<title>Welcome</title>
</head>
<body>

<h1>??? Welcomes You!</h1>
<br>
<br>
<form action="feedback.php" method="post">
<p>Title:
<select name="title">

<option selected>" "</option>
<option>Prof</option>
<option>Mr</option>
<option>Mrs</option>
<option>Ms</option>
<option>Dr</option>
<option>Miss</option>
</select>
</p>

First Name:
<input type="text" name="FirstName"><br>
Last Name:
<input type="text" name="LastName"><br>
Address:
<input type="text" name="Address"><br>
Apt/Unit:
<input type="text" name="Apt/Unit"><br>
<br>
City:
<input type="text" name="City"><br>
State:
<input type="text" name="State"><br>
Zip:
<input type="text" name="Zip"><br>
<br>
Email:
<input type="text" name="email"><br>
<br>
Memo:
<textarea name="memo"></textarea>
<br>
<br>
<input type="submit" name="submit" value="submit">

</form>
</body>
</html>
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 34
Reputation: pbrookee is an unknown quantity at this point 
Solved Threads: 0
pbrookee pbrookee is offline Offline
Light Poster

Re: Web Form

 
0
  #2
Jun 6th, 2007
I got it!
I just put it in a table format! Works beautifully!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Web Form

 
0
  #3
Jun 8th, 2007
You can apply CSS styles to it too.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 5
Reputation: Mrtony is an unknown quantity at this point 
Solved Threads: 0
Mrtony Mrtony is offline Offline
Newbie Poster

Re: Web Form

 
0
  #4
Jul 11th, 2007
please before you learn bad habits, tables are for data, divs are for layout. you will benefit greatelly from using the right approach from the start. All designers and advanced developers use divs
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 8
Reputation: brotherZ is an unknown quantity at this point 
Solved Threads: 0
brotherZ brotherZ is offline Offline
Newbie Poster

Re: Web Form

 
0
  #5
Jul 12th, 2007
Originally Posted by Mrtony View Post
please before you learn bad habits, tables are for data, divs are for layout. you will benefit greatelly from using the right approach from the start. All designers and advanced developers use divs
I never knew that. So you can not use tables for layout????
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Web Form

 
0
  #6
Jul 13th, 2007
So you can not use tables for layout????
(You can, but the big baddies at W3C don't want you to.)

The problem is that divs don't always work exactly the way you want them to, especially when they are inside other layout tags. I gave up after SIX hours of trying to get a simple three-column set of divs
to line up correctly inside a pair of li tags. It always either dropped one div to a lower area, or took some of the text below the ending li tag and put it on the right of the three divs, or failed to display correctly on one browser while working on the others.

Here is code that fails. Somebody please tell me why. You will note that the set of divs inside the li pair fails, but the ones down below the ul pair work correctly. And IE messes it up differently than FF does. The ONLY difference between the two is that one set is inside the ul list's li pair.

HTML and CSS Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <style>
  4.  
  5. .x3col {float: left; margin: none; border: none; padding: none; width: 33%;}
  6. </style>
  7. </head>
  8. <body>
  9. <ul>
  10. <li><p>Here is the list:</p>
  11. <div class="x3col">
  12. <ol>
  13. <li>one</li>
  14. <li>two</li>
  15. <li>three</li>
  16. </ol>
  17. </div>
  18. <div class="x3col">
  19. <ol>
  20. <li>four</li>
  21. <li>five</li>
  22. <li>six</li>
  23. <li>seven</li>
  24. </ol>
  25. </div>
  26. <div class="x3col">
  27. <ol>
  28. <li>eight</li>
  29. <li>nine</li>
  30. <li>ten</li>
  31. <li>eleven</li>
  32. </ol>
  33. </div>
  34. </li>
  35. <li>Here's the end of the list</li>
  36. </ul>
  37. <p>Here is the next line</p>
  38. <p>And down here, it works.</p>
  39. <div class="x3col">
  40. <ol>
  41. <li>one</li>
  42. <li>two</li>
  43. <li>three</li>
  44. </ol>
  45. </div>
  46. <div class="x3col">
  47. <ol>
  48. <li>four</li>
  49. <li>five</li>
  50. <li>six</li>
  51. <li>seven</li>
  52. </ol>
  53. </div>
  54. <div class="x3col">
  55. <ol>
  56. <li>eight</li>
  57. <li>nine</li>
  58. <li>ten</li>
  59. <li>eleven</li>
  60. </ol>
  61. </div>
  62. <p>Here is the next line</p>
  63. </body>
  64. </html>
Until they get their ducks in a row and make it work for all browsers and when nested inside other items, I say go ahead and make tables. The parts of a form can be considered table entries anyway.
Last edited by MidiMagic; Jul 13th, 2007 at 5:56 am.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 37
Reputation: ¤| battousai |¤ is an unknown quantity at this point 
Solved Threads: 1
¤| battousai |¤ ¤| battousai |¤ is offline Offline
Light Poster

Re: Web Form

 
0
  #7
Jul 13th, 2007
The reason the first list gets screwed is because 'none' is not a valid property for the margin and padding attributes, use 0px or just 0 instead

My gues is that the floated divs in the unordered list cause the 'end of the list' to stick behind it, rather than drop below, so i aplied clear: left to it. Lasty i got rid of the list bullets for the unordered list.

here is the code, it works in both FF and IE

  1. <html>
  2. <head>
  3. <style>
  4. .x3col {
  5. float: left;
  6. margin: 0px;
  7. padding: 0px;
  8. border: none;
  9. width: 33%;
  10. }
  11.  
  12. .endline {
  13. clear:left;
  14. }
  15.  
  16. ul {
  17. padding: 0px;
  18. margin: 0px;
  19. list-style: none;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <ul>
  25. <li>
  26. <p>Here is the list:</p>
  27. <div class="x3col">
  28. <ol>
  29. <li>one</li>
  30. <li>two</li>
  31. <li>three</li>
  32. </ol>
  33. </div>
  34. <div class="x3col">
  35. <ol>
  36. <li>four</li>
  37. <li>five</li>
  38. <li>six</li>
  39. <li>seven</li>
  40. </ol>
  41. </div>
  42. <div class="x3col">
  43. <ol>
  44. <li>eight</li>
  45. <li>nine</li>
  46. <li>ten</li>
  47. <li>eleven</li>
  48. </ol>
  49. </div>
  50. </li>
  51. <li class="endline">Here's the end of the list</li>
  52. </ul>
  53. <p>Here is the next line</p>
  54. <p>And down here, it works.</p>
  55. <div class="x3col">
  56. <ol>
  57. <li>one</li>
  58. <li>two</li>
  59. <li>three</li>
  60. </ol>
  61. </div>
  62. <div class="x3col">
  63. <ol>
  64. <li>four</li>
  65. <li>five</li>
  66. <li>six</li>
  67. <li>seven</li>
  68. </ol>
  69. </div>
  70. <div class="x3col">
  71. <ol>
  72. <li>eight</li>
  73. <li>nine</li>
  74. <li>ten</li>
  75. <li>eleven</li>
  76. </ol>
  77. </div>
  78. <p>Here is the next line</p>
  79. </body>
  80. </html>
Last edited by ¤| battousai |¤; Jul 13th, 2007 at 7:53 am.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Web Form

 
0
  #8
Jul 17th, 2007
There are several problems with your "solution":

1. The books that I use say that "none" is always allowed as a way to remove a style.

2. Changing "none" to "0px" didn't change anything.

3. The clear style is clearly a kludge. The contents of a list element should not have the power to change the way the list itself renders.

4. The clear style fixed the FF display, but not the IE display. But we shouldn't have to do that.

5. I want the bullets in my page.

6. Doing your whole thing still doesn't fix the IE display. The third column still drops under the first.

7. Setting the margin and padding on the ul to 0px removes the bullets on both browsers, even with the list-style part removed. I want the bullets.

The problem is that the div method of making columns is not yet perfected.
Last edited by MidiMagic; Jul 17th, 2007 at 6:04 pm.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 42
Reputation: cereal is an unknown quantity at this point 
Solved Threads: 4
cereal cereal is offline Offline
Light Poster

Re: Web Form

 
0
  #9
Aug 3rd, 2007
For my forms I use definition lists (<dl>) instead of tables or divs. I put labels in <dt> and input, textarea, option and select in <dd>. And then I use stylesheets to improve it.

This way:
HTML and CSS Syntax (Toggle Plain Text)
  1. <div id="form">
  2. <form method="post" action="check.php">
  3. <dl>
  4.  
  5. <dt><label for="user">User:</label></dt>
  6. <dd><input name="user" type="text" class="text" /></dd>
  7.  
  8. <dt><label for="pass">Pass:</label></dt>
  9. <dd><input name="pass" type="password" class="text" />
  10. <input type="submit" name="submit" value="login" class="button" /></dd>
  11.  
  12. </dl>
  13. </form>
  14. </div>

The CSS part:
HTML and CSS Syntax (Toggle Plain Text)
  1. * { margin: 0; padding: 0; }
  2.  
  3. body {
  4. font: 12px/17px Verdana, Arial, sans-serif;
  5. color: #111;
  6. background-color: #fff;
  7. }
  8.  
  9. #form {
  10. display: block;
  11. margin: 0px auto;
  12. width: 320px;
  13. }
  14.  
  15. dl {
  16. width: 300px;
  17. }
  18.  
  19. dt label {
  20. font-weight: bold;
  21. margin: 10px 0 5px;
  22. }
  23.  
  24. input.text {
  25. width: 100%;
  26. font-size: 14px;
  27. color: #000;
  28. background: #eee;
  29. border: 1px dotted #666;
  30. }
  31.  
  32. input.button {
  33. float: right;
  34. font-size: 14px;
  35. color: #000;
  36. background: #eee;
  37. border: 1px dotted #777;
  38. width: 50px;
  39. padding: .1em;
  40. margin: 15px 0 0;
  41. }

This way if css fails or is disabled, the form will still mantain a good appearance and usability.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC