Semantic horizontal Forms

Geplaatst in Webdesign Reeds 90 reacties op dit bericht

As promised in a previous blog post here, Horizontally aligned elements in forms, i’ve tried to work out a way to reproduce the registration form at http://www.squarespace.com/join/ in a semantically correct way with fieldsets, legends, labels and some CSS styling. This is what i’ve come up with : http://www.skyrocket.be/lab/semantic_horizontal_form.html

Horizontal forms

I’ve rewritten the XHTML in a semantic way and positioned the form elements next to eachother except for the last fieldset which spans the full width of the form below the 3 top fieldsets. It’s been tested in FF1.x, IE6 and Opera8. (looks a little quirky in IE5.x but still usable) I’ve added a conditional comment to fix a padding error in IE but without this the form would still be legible and fully usable, it’s just a small cosmetic adjustment.

I’ve already received some emails from Kevin at el73.be who’s been working on another method which depends less on em widths. Wonder how he’s been coming along on this. Kevin?

Update: Some minor bugs fixed with field labels. Thanks Dan and Michael.

Update 2: Fixed questionable semantics by adding and hiding correct legend text, thanks Adam and Joe.
Added error messages as requested by A. Casalena


Reacties

  1. 1
    Mon 09 Jan
    Kevin zei:

    Like I said: it’s a great way of achieving the desired layout. And it’s semantically correct! I’d like to see something without the need to specify the height though. I’m gonna give that another go.

    13:54
  2. 2
    Mon 09 Jan

    Great job! There’s some beautiful code behind this form. At the risk of nitpicking, the labels for the password and email inputs are incorrect. Other than that, great job!

    16:48
  3. 3
    Mon 09 Jan
    Gerben zei:

    Nice one.
    I would however suggest less cryptic legend-text
    1. 2. 3. is enough for sighted people but with screenreaders I would suggest:
    Step 1. Step 2. Step 3.
    Just add a span and use CSS to prevent ‘Step’ from being visible.

    17:33
  4. 4
    Mon 09 Jan

    Nice work! A really semantic code. Congratulations.

    17:37
  5. 5
    Mon 09 Jan

    Very cool :) Are we allowed to borrow this? :)

    Also — how do the elements stretch if you introduce errors? On the Squarespace site, we highlight the block and expand it a bit with an error message if there is one.

    18:02
  6. 6
    Mon 09 Jan
    Mark C zei:

    It’s not only semantic, it’s also eye-catching Nice work ‘neighbor’ ;-)

    18:36
  7. 7
    Mon 09 Jan

    Semantic horizontal Forms

    Chris heeft zich moeite gedaan om een mooie en semantisch correct invulformulier te maken.
    Allee, hij heeft er één van het net geplukt en beter en juister gemaakt.
    In mijn ogen (maar wie ben ik?) is dit het gebruiksvriendelijkste en mooiste invulf…

    18:47
  8. 8
    Mon 09 Jan

    Dan Mall:
    Oops, thanks for noticing. It’s been noted and will be taken care of.

    A. Casalena:
    Ofcourse, you are free to re-use and ab-use the code as you see fit and implement it in your website. I’ll take a look at the implementation of error messages. The form is fully zoomable (hit CTRL and + in firefox to see the effect) so i don’t see why the error messages wouldn’t work.

    Gerben:
    I only reproduced the form as i found it on Squarespace’s website, but it’s a good idea. I’ll add the code together with the error update A. Casalena suggested.

    The rest:
    Thanks :)

    19:30
  9. 9
    Mon 09 Jan
    Adam zei:

    I think you’re a bit off with the semantics. The legend tag should be a descriptor of the elements it contains, so it’s not “1″, it’s “Pick a login name”.

    20:00
  10. 10
    Mon 09 Jan
    Joe zei:

    Still not quite valid, but Dan has already pointed that out. Other than that, very nice!

    21:13
  11. 11
    Mon 09 Jan
    michael zei:

    the lables are not working correctly on FF

    21:33
  12. 12
    Mon 09 Jan

    Michael:
    Dan already pointed that out in #2, i’ve fixed it.

    Adam & Joe
    Thanks for pointing that out, i did state that i was reproducing the form like it appeared on the Squarespace website, i didn’t say it was semantically perfect. Just a better solution that putting a bunch of divs behind eachother. It might be interesting to combine your comments with gerben’s in #3. Noted that, thanks!

    21:38
  13. 13
    Tue 10 Jan

    [...] Gisteren kwam Chris op de proppen met zijn methode om horizontale forms semantisch voor te stellen. Knap werk. Het enige "probleem" dat ik er mee heb is dat je een vaste hoogte moet opgeven voor de parent elements. Chris heeft in ieder geval het wijze besluit genomen om dit met behulp van de relatieve em eenheid zodat de hoogte meeschaalt met de grootte van het lettertype. Maar ik wil het iets anders doen. [...]

    08:28
  14. 14
    Tue 10 Jan
    Steven zei:

    Very nice man, your article even got a post on cssbeauty.com

    http://www.cssbeauty.com/archi...../index.php

    Very nice indeed.

    09:56
  15. 15
    Wed 11 Jan
    david zei:

    wow this is great a munst use

    00:26
  16. 16
    Thu 12 Jan
    12:23
  17. 17
    Sat 14 Jan
    Gregor zei:

    I would add cursor:pointer to the labels and inputs to show that users can click here.

    21:10
  18. 18
    Sun 15 Jan

    [...] Chris heeft voor een mooi voorbeeld gezorgd met zijn semantische horizontale formulieren. De moeite waard om te bekijken! [...]

    13:48
  19. 19
    Thu 19 Jan

    [...] Réaliser un formulaire horizontal valide CSS et compagnie [...]

    01:29
  20. 20
    Fri 20 Jan

    [...] El resto: un ‘hack’ sobre flujo de cajas, formularios horizontales y sem?nticos y una combinaci?n de “wicked look” con un “layout l?quido”. [...]

    20:09
  21. 21
    Wed 25 Jan
    Voosh zei:

    Technically not a one-step signup if there are three steps to it.

    11:15
  22. 22
    Sun 05 Feb
    18:43
  23. 23
    Wed 26 Apr

    [...] Semantic horizontal Forms [...]

    15:41
  24. 24
    Sun 18 Jun

    [...] Chris heeft voor een mooi voorbeeld gezorgd met zijn semantische horizontale formulieren. De moeite waard om te bekijken! Bookmark:Deze icoontjes linken naar social bookmarking sites waar lezers links kunnen delen en nieuwe sites kunnen ontdekken. [...]

    11:02
  25. 25
    Tue 17 Apr
    06:06
  26. 26
    Mon 11 Jun

    [...] Sky Rocket – Semantic Horizontal forms [...]

    17:13
  27. 27
    Mon 11 Jun

    [...] Sky Rocket – Semantic Horizontal forms [...]

    21:35
  28. 28
    Thu 14 Jun
    16:24
  29. 29
    Tue 19 Jun

    [...] Sky Rocket – Semantic Horizontal forms [...]

    09:22
  30. 30
    Tue 03 Jul

    [...] Sky Rocket – Semantic Horizontal forms [...]

    14:27
  31. 31
    Fri 06 Jul
    23:49
  32. 32
    Tue 10 Jul

    [...] Semantic Horizontal Forms [...]

    14:31
  33. 33
    Fri 20 Jul

    [...] Semantic Horizontal Forms [...]

    15:09
  34. 34
    Wed 22 Aug
    Chad zei:

    Thanks for the article!

    Just one question, can you give me an explanation of how can you make it work without floating #theform to the left? Because all the fieldset are set to float:left, and if I don’t float #theform as well, I won’t be able to wrap the fieldset. What I’m doing wrong?

    Thanks.

    07:43
  35. 35
    Wed 29 Aug
    12:03
  36. 36
    Sat 01 Sep
    18:52
  37. 37
    Mon 22 Oct
    09:20
  38. 38
    Sat 03 Nov

    [...] Semantic Horizontal Forms [...]

    08:52
  39. 39
    Fri 16 Nov

    [...] 表单设计 CSS风格的表单 横向语义表单 修改表单字段 [...]

    18:17
  40. 40
    Sun 18 Nov

    [...] Semantic horizontal Forms [...]

    10:03
  41. 41
    Wed 05 Dec

    [...] un post di Chris Ramakers sul suo blog che riscriveva semanticamente la form di iscrizione di squarespace [...]

    17:15
  42. 42
    Sat 29 Dec

    [...] in CSS, Picment: Fun with forms – customized input elements, Mezzoblu zu Labeling Formfield, Chris Ramakers, skyrocket concepts: semantisch korrekte horizontale Formulare step 1 – 2 – 3, Malarkey: optionale Formularbereiche ausblenden, Brand spanking New: AutoSuggest: An Ajax [...]

    10:58
  43. 43
    Sun 06 Jan
    11:08
  44. 44
    Mon 28 Jan

    [...] Semantic Horizontal Forms [...]

    23:53
  45. 45
    Mon 11 Feb

    [...] Semantic Horizontal Forms [...]

    09:05
  46. 46
    Thu 14 Feb
    06:31
  47. 47
    Thu 21 Feb

    [...] Semantic horizontal Forms [...]

    08:11
  48. 48
    Sat 23 Feb

    Will use it on my site for sure, nice.

    22:52
  49. 49
    Mon 10 Mar
    Ravi zei:

    Actually New link https://www.squarespace.com/signup/

    15:57
  50. 50
    Mon 10 Mar

    [...] Semnatic horizontal Forms [...]

    19:25
  51. 51
    Fri 14 Mar
    Steve zei:

    Very nice work – gives me many ideas to think about – thanks.

    05:30
  52. 52
    Tue 18 Mar

    First of all, thanks for sharing this with the rest of the world. Looks really great!

    At the risk of sounding redundant or ungrateful (which I’m not), I found that the “repeat e-mail address” field is all messed up in Firefox.

    Example screen capture

    Again, thanks for sharing this!

    21:40
  53. 53
    Wed 23 Apr
    09:25
  54. 54
    Mon 05 May
    06:02
  55. 55
    Tue 13 May

    [...] Skyrocket.be » Semantic horizontal Forms (tags: CSS webdesign forms) [...]

    01:39
  56. 56
    Sun 13 Jul
    10:50
  57. 57
    Tue 22 Jul

    [...] Form Assembly – Form Layouts CSS Styling of forms, Stu Nicholls Semantic Horizontal Forms Trimming form fields Badboy Niceforms Functional Pretty Forms CSS-Only, Table-less [...]

    04:14
  58. 58
    Thu 11 Sep

    [...] 1. Semantic Horizontal Form [...]

    07:19
  59. 59
    Thu 18 Sep

    [...] Semantic Horizontal Forms [...]

    11:19
  60. 60
    Fri 19 Sep
    15:46
  61. 61
    Tue 23 Sep
    Kyle zei:

    First off: This is great, thank you!

    Just one question though: Can you tell me how to fix the Firefox issue? I’m using firefox 2.0.0.16, and I’m getting the same problem as WebGvyer. See screenshot:

    http://usera.imagecave.com/web.....l_form.gif

    18:20
  62. 62
    Sat 27 Sep

    [...] Semantic Horizontal Forms [...]

    14:12
  63. 63
    Fri 31 Oct

    [...] Semantic Horizontal Forms [...]

    05:46
  64. 64
    Fri 21 Nov

    [...] Formularios semánticos horizontales [...]

    07:30
  65. 65
    Sat 22 Nov
    Rene zei:

    Great example, thanks.

    04:33
  66. 66
    Wed 03 Dec

    [...] Semantic Horizontal Forms [...]

    11:55
  67. 67
    Thu 01 Jan
    20:54
  68. 68
    Mon 02 Feb

    [...] Semantic Horizontal Forms [...]

    19:10
  69. 69
    Fri 13 Feb

    [...] Semantic horizontal Forms [...]

    08:20
  70. 70
    Thu 30 Apr
    ASHWIN zei:

    GREATE DESIGN

    05:28
  71. 71
    Tue 05 May
    07:37
  72. 72
    Wed 01 Jul

    [...] Semantic horizontal Forms: [...]

    22:01
  73. 73
    Mon 27 Jul

    I am having a peculiar problem with the form that i am writing. It has two form elements horizontally placed using CSS. While two text elements align beautifully in both IE & Firefox, when i try to align the select and text together then wrap below. What can be the problem? any ideas to solve this?

    06:57
  74. 74
    Tue 11 Aug

    [...] Semantic Horizontal Forms [...]

    09:10
  75. 75
    Fri 25 Sep
    08:21
  76. 76
    Tue 29 Sep
    18:16
  77. 77
    Thu 01 Oct
    pablo zei:

    really well done!

    09:15
  78. 78
    Tue 27 Oct
    Eduardo zei:

    Great article, it is hard to find something like this, hugs …

    14:56
  79. 79
    Wed 04 Nov

    Doesn’t seem to format properly in FireFox 3.0.15.

    12:05
  80. 80
    Mon 16 Nov

    [...] Here’s where I got the CSS stylesheet from. [...]

    19:57
  81. 81
    Wed 18 Nov
    lalit zei:

    nice!
    its a great design and good CSS thanx.

    10:57
  82. 82
    Wed 02 Dec

    [...] Semantic Horizontal Forms [...]

    22:40
  83. 83
    Thu 17 Dec

    [...] Fixed questionable semantics by adding and hiding correct legend text, thanks Adam and Joe. Added error messages as requested by A. Casalena Demo: http://www.skyrocket.be/lab/se....._form.html Source: http://www.skyrocket.be/2006/0.....tal-forms/ [...]

    18:34
  84. 84
    Sun 31 Jan
    19:19
  85. 85
    Thu 04 Feb
    10:07
  86. 86
    Thu 11 Feb
    Ben zei:

    Thanks mate. Appreciated your design!

    22:41
  87. 87
    Tue 16 Mar

    [...] Semantic Horizontal Forms [...]

    18:04
  88. 88
    Thu 18 Mar
    12:52
  89. 89
    Mon 05 Apr

    [...] Semantic Horizontal Form This form is coded in a semantic way and the elements are positioned next to eachother except for the last fieldset which spans the full width of the form below the 3 top fieldsets. It’s been tested in FF1.x, IE6 and Opera8. (looks a little quirky in IE5.x but still usable) [...]

    22:59
  90. 90
    Mon 17 May

    [...] 8. Semantic horizontal form [...]

    20:25

Reageer

XHTML: Je mag volgende XHTML tags gebruiken: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>