SlideShare uma empresa Scribd logo
1 de 102
 
AARON GUSTAFSON EASY! DESIGNS, LLC
FORMS ARE A NECESSARY EVIL
SIMPLE FORM: CONTACT US
SIMPLE FORM: CONTACT US < form  id = &quot;contact-form&quot;   action = &quot;/action-page.php&quot;   method = &quot;post&quot; > <!-- the rest of our form will go here --> </ form > FORM  Element establishes a form ACTION  is the only required attribute and should always be a URI METHOD  defaults to “get” NAME  is depreciated; use  ID  instead
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> < fieldset >   <legend> Send us a message </legend>   <!-- the rest of our form will go here -->   </ fieldset > </form> FIEDSET  Element used to group related fields LEGEND  Element used to provide a caption for a  FIELDSET
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset>   <legend> Send us a message </legend> < p > <!-- form control --> </ p > < p > <!-- form control --> </ p > < p > <!-- form control --> </ p > </fieldset> </form> Containing  FORM  Controls P  or  DIV sensible choices, but not very accurate (except in certain instances) OL  or  UL most forms are lists of questions or form controls, so these are better <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset>   <legend> Send us a message </legend> < ol > < li > <!-- form control --> </ li > < li > <!-- form control --> </ li > < li > <!-- form control --> </ li > </ ol > </fieldset> </form>
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li> Name < input  type = &quot;text&quot;  name = &quot;name&quot;   id = &quot;contact-name&quot;  /> </li> <li> Email < input  type = &quot;text&quot;  name = &quot;email&quot;   id = &quot;contact-email&quot;  /> </li> <li> <!-- form control --> </li> </ol> </fieldset> </form> INPUT  Text Control type= &quot;name&quot;  is a basic text input field (also  type= &quot;password&quot;  for content you want hidden) NAME  vs.  ID NAME  is for the back end ID  is for the front end
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li>Name <input type=&quot;text&quot; name=&quot;name&quot; id=&quot;contact-name&quot; /></li> <li>Email <input type=&quot;text&quot; name=&quot;email&quot; id=&quot;contact-email&quot; /></li> <li> Message   < textarea  name = &quot;message&quot;    id = &quot;contact-message&quot;   rows = &quot;4&quot;  cols = &quot;30&quot; > </ textarea > </li> </ol> </fieldset> </form> TEXTAREA a multiline text form control requires  ROWS  and  COLS  attributes!!!
SIMPLE FORM: CONTACT US Working with  LABEL   this element provides to means of associating its content with a form control: implicit association LABEL  wraps the form control and the text explicit association LABEL 's  FOR  attribute is an  ID  reference to the form control <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset>   <legend> Send us a message </legend> <ol> <li> < label  for = &quot;contact-name&quot; > Name </ label> < input  id = &quot;contact-name&quot;  ...   /> </li>   ... </ol> </fieldset> </form> <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset>   <legend> Send us a message </legend> <ol> <li> < label > Name < input  ...   /></ label> </li>   ... </ol> </fieldset> </form>
SIMPLE FORM: CONTACT US Buttons trigger events in a form; use either  INPUT  or  BUTTON  element Common  TYPE s submit  – submits the form; default button type reset  – resets all form control values back to their defaults when the page loaded <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... </ol> <button  type = &quot;submit&quot; > Go </button> </fieldset> </form> <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... </ol> <input  type = &quot;submit&quot;   value = &quot;Go&quot; / > </fieldset> </form>
SIDEBAR : BUTTONS WINDOWS XP OS X BUTTON INPUT Mozilla IE 6/7 (XP) IE 6/7 (classic) Opera Opera IE 5 Firefox Camino Safari
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot;   name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot;   name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot;   name=&quot;message&quot; rows=&quot;4&quot;   cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot;   cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> body { font: 62.5% &quot;Lucida Sans Unicode&quot;, &quot;Lucida Grande&quot;,  sans-serif; } ol, ul, p { font-size: 1.2em; line-height: 1.5; }
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot;   cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> form, fieldset, legend { border: 0; padding: 0; margin: 0; } legend { font-size: 2em; } form ol, form ul { list-style: none; margin: 0; padding: 0; }
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot;   cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> form li { margin: 0 0 .75em; } label { display: block; } input, textarea { width: 250px; }
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot;   cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> form li { clear: both; margin: 0 0 .75em; padding: 0; } label { display: block; float: left; line-height: 1.6; margin-right: 10px; text-align: right; width: 120px; }
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot;   cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> legend { font-size: 2em; line-height: 1.8; padding-bottom: .5em; } button { margin-left: 130px; cursor: pointer; }
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot;   cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> label:after { content: ':'; } input, textarea { background: #ddd; width: 250px; } input:focus, textarea:focus { background: #fff; } /* Some styles to get   the baselines to   match & to unify the   type used */
SIMPLE FORM: CONTACT US body { font: 62.5% &quot;Lucida Sans   Unicode&quot;, &quot;Lucida Grande&quot;,   sans-serif; } ol, ul, p { font-size: 1.2em; line-height: 1.5; } form, fieldset, legend { border: 0; margin: 0; padding: 0; } legend { font-size: 2em; line-height: 1.8; padding-bottom: .5em; } form ol, form ul { list-style: none; margin: 0; padding: 0; } form li { clear: both; margin: 0 0 .75em; padding: 0; } label { display: block; float: left; line-height: 1.6; margin-right: 10px; text-align: right; width: 120px; } label:after { content: ':'; } input, textarea { background: #ddd; font: 1em Arial, Helvetica,   sans-serif; padding: 1px 3px; width: 250px; } textarea { line-height: 1.3em; padding: 0 3px; } input:focus, textarea:focus { background: #fff; } button { background: #ffd100; border: 2px outset #333; color: #333;   cursor: pointer; font-size: .9em; font-weight: bold; letter-spacing: .3em; margin-left: 130px; padding: .2em .5em; text-transform: uppercase; }
SIMPLE FORM: CONTACT US
SIMPLE FORM: CONTACT US SELECT ion Lists allows selection of one or more  OPTION s On  OPTION  elements,  the  VALUE  attribute is optional (contents are submitted by default) <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li>< label    for = &quot;contact-subject&quot; > Subject </ label > < select  id = &quot;contact-subject&quot;   name = &quot;subject&quot; > < option  value = &quot;Error&quot; > I noticed a   website error </ option > < option  value = &quot;Question&quot; > I have a   question </ option > < option > Other </ option > </ select ></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
SIDEBAR: OPTGROUPS < select  id = &quot;favorite-fruit&quot;  name = &quot;favorite-fruit&quot; > < optgroup  label = &quot;Apples&quot; > < option  value = &quot;Golden Delicious Apples&quot; > Golden Delicious </ option > < option  value = &quot;Granny Smith Apples&quot; > Granny Smith </ option > < option  value = &quot;Macintosh Apples&quot; > Macintosh </ option > < option  value = &quot;Red Delicious Apples&quot; > Red Delicious </ option > </ optgroup > < optgroup  label = &quot;Berries&quot; > < option > Blackberries </ option > < option > Blueberries </ option > < option > Raspberries </ option > < option > Strawberries </ option > </ optgroup > </ select >
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li> <label for=&quot;contact-subject&quot;>Subject</label> <select id=&quot;contact-subject&quot; name=&quot;subject&quot;> <option value=&quot;Error&quot;>I noticed a website error</option> <option value=&quot;Question&quot;>I have a question</option> <option>Other</option> </select> </li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li> <label for=&quot;contact-subject&quot;>Subject</label> <select id=&quot;contact-subject&quot; name=&quot;subject&quot;> <option value=&quot;Error&quot;>I noticed a website error</option> <option value=&quot;Question&quot;>I have a question</option> <option>Other</option> </select> </li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> select { background: #ddd; width: 260px; /* width is *usually*    the input width +   input padding +    4px */ } input:focus, textarea:focus , select:focus  { background: #fff; }
SIDEBAR : SELECTS  WINDOWS XP OS X Mozilla IE 7 (classic) IE 6/7 (XP) IE 6 (classic) Opera Opera IE 5 Firefox Camino Safari
SIMPLE FORM: CONTACT US
SIMPLE FORM: CONTACT US Nested  FIELDSET s a great way to organize radio or checkbox groups The  LEGEND  is the question or statement Lists organize the possible responses ( OL  or  UL ) implicit  LABEL s provide an easy way to style in IE6 ... < li > < fieldset  class = &quot;radio&quot; > < legend > I would prefer to be    contacted by </ legend > < ul > < li >< label >< input  type = &quot;radio&quot;   name = &quot;method&quot;  value = &quot;email&quot;  />   email </ label ></ li > < li >< label >< input  type = &quot;radio&quot;   name = &quot;method&quot;  value = &quot;phone&quot;  />   phone </ label ></ li > </ ul > </ fieldset > </ li > ...
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; />   email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; />   phone</label></li> </ul> </fieldset> </li> ... </form>
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; />   email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; />   phone</label></li> </ul> </fieldset> </li> ... </form> .radio legend { font-size: 1em; line-height: 1.5; padding: 0 0 0 6px; margin: 0; } .radio label { display: inline; width: auto; margin: 0; }
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; />   email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; />   phone</label></li> </ul> </fieldset> </li> ... </form> .radio { margin-left: 125px; } .radio ul { font-size: 1em; margin: .3em 0 0; } .radio label:after { content: ''; } label input { background:   transparent; width: auto; }
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; />   email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; />   phone</label></li> </ul> </fieldset> </li> ... </form> .radio li { float: left; margin: 0; width: 48%; clear: none; } label input { width: auto; position: relative; top: 2px; }
SIMPLE FORM: CONTACT US .radio legend { font-size: 1em; line-height: 1.5; padding: 0 0 0 6px; margin: 0; max-width: 270px; width: 270px; } ... <fieldset class=&quot;radio&quot;> <legend> This is an exceedingly long  < code > LEGEND </ code >  to demonstrate the odd behavior of  < code > LEGEND </ code > s </legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; />   email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; />   phone</label></li> </ul> </fieldset> ...
SIMPLE FORM: CONTACT US .radio legend span { display: block; width: 270px; } ... <fieldset class=&quot;radio&quot;> <legend> <span> This is an exceedingly long   <code>LEGEND</code> to demonstrate the odd behavior of   <code>LEGEND</code>s </ span > </legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; />   email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; />   phone</label></li> </ul> </fieldset> ...
SIMPLE FORM: CONTACT US
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... < li  class = &quot;confirm&quot; > < input  type = &quot;hidden&quot;  name = &quot;mailing-list&quot;   value = &quot;0&quot;  /> < label >< input  type = &quot;checkbox&quot;   name = &quot;mailing-list&quot;  value = &quot;1&quot;  /> Please add me to your mailing   list </ label ></ li > ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> Confirmations a little  CLASS ification goes a long way
SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li class=&quot;confirm&quot;> <input type=&quot;hidden&quot; name=&quot;mailing-list&quot; value=&quot;0&quot; /> <label><input type=&quot;checkbox&quot; name=&quot;mailing-list&quot; value=&quot;1&quot; /> Please add me to your mailing list</label></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
SIMPLE FORM: CONTACT US .confirm label { display: block; float: none; margin-left: 125px; text-align: left; width: 270px; } <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li class=&quot;confirm&quot;> <input type=&quot;hidden&quot; name=&quot;mailing-list&quot; value=&quot;0&quot; /> <label><input type=&quot;checkbox&quot; name=&quot;mailing-list&quot; value=&quot;1&quot; /> Please add me to your mailing list</label></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
SIMPLE FORM: CONTACT US .confirm { margin-bottom: 1.4em; } .radio label:after , .confirm label:after  { content: ''; } <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li class=&quot;confirm&quot;> <input type=&quot;hidden&quot; name=&quot;mailing-list&quot; value=&quot;0&quot; /> <label><input type=&quot;checkbox&quot; name=&quot;mailing-list&quot; value=&quot;1&quot; /> Please add me to your mailing list</label></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
MORE FORMS FORMS   OF
SIMPLE FORM: SEARCH BOX
SIMPLE FORM: SEARCH BOX  POST vs. GET Search forms are traditionally GET requests to allow the action page (i.e. the results) to be bookmarkable. < form  id = &quot;search-form&quot;   action = &quot;/action-page.php&quot;   method = &quot;get&quot; > <!-- the rest of our form will go here --> </ form >
SIMPLE FORM: SEARCH BOX  You need something Sometimes a  FIELDSET  is unnecessary, but in XHTML, you need something to wrap the contents of a form <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <!-- the rest of our form will go here --> <p> </form>
SIMPLE FORM: SEARCH BOX  Easy-peasy <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> < label  for = &quot;search-query&quot; > Search this    site for </ label > < input  type = &quot;text&quot;  id = &quot;search-query&quot;   name = &quot;query&quot;  /> <p> </form>
SIMPLE FORM: SEARCH BOX  It’s a  BUTTON big shock, I know <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> < button  type = &quot;submit&quot; > Go </ button > <p> </form>
SIMPLE FORM: SEARCH BOX  <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> <button type=&quot;submit&quot;>Go</button> <p> </form> body { background: #54af44; font: 62.5% &quot;Lucida   Sans Unicode&quot;, &quot;Lucida   Grande&quot;, sans-serif; } ol, ul, p { font-size: 1.2em; line-height: 1.5; }
SIMPLE FORM: SEARCH BOX  <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> <button type=&quot;submit&quot;>Go</button> <p> </form> label { line-height: 2em; } input { border: 1px solid #c00; background: #ebebeb; margin: 0 .5em; padding: 2px 4px; } input:focus { background: #fff; }
SIMPLE FORM: SEARCH BOX  <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> <button type=&quot;submit&quot;>Go</button> <p> </form> button { background: #c00; border: 0; color: #fff; cursor: pointer; font-size: .9em; font-weight: bold; letter-spacing: .1em; padding: 2px 8px; text-transform:   uppercase; }
SIMPLE FORM: DATE SELECT
SIMPLE FORM: DATE SELECT Getting organized < fieldset  class = &quot;date&quot; > <!-- the rest will go here --> </ fieldset >
SIMPLE FORM: DATE SELECT Not really a  LABEL <fieldset class=&quot;date&quot;> < legend > Post Date </ legend > <!-- the rest will go here --> </fieldset>
SIMPLE FORM: DATE SELECT Not just a  SELECT we need some  LABEL ing <fieldset class=&quot;date&quot;> <legend>Post Date</legend> < ol > < li > < label  for = &quot;date-day&quot; > Date </ label > < select  id = &quot;date-day&quot;  name = &quot;day&quot; > < option > 01 </ option > ... < option > 31 </ option > </ select > </ li > </ ol > </fieldset>
SIMPLE FORM: DATE SELECT And so on <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li> <label for=&quot;date-day&quot;>Date</label> ... </li> < li > < label  for = &quot;date-month&quot; > Month </ label > < select  id = &quot;date-month&quot;  name = &quot;month&quot; > < option  value = &quot;01&quot; > January </ option > ... < option  value = &quot;12&quot; > December </ option > </ select > </ li > </ ol > </ fieldset >
SIMPLE FORM: DATE SELECT And so forth <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li> <label for=&quot;date-day&quot;>Date</label> ... </li> <li> <label for=&quot;date-month&quot;>Month</label> ... </li> < li > < label  for = &quot;date-year&quot; > Year </ label > < select  id = &quot;date-year&quot;  name = &quot;year&quot; > < option > 2007 </ option > < option > 2008 </ option > </ select > </ li > </ol> </fieldset>
SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> body { background: #54af44; font: 62.5% &quot;Lucida   Sans Unicode&quot;, &quot;Lucida   Grande&quot;, sans-serif; } ol, ul, p, legend { font-size: 1.2em; line-height: 1.5; } legend { color: #000; }
SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date { border: 0; padding: 0; } .date ol { list-style: none; margin: 0 0 0 130px; padding: 0; }
SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date li { float: left; }
SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date select { background: #e2efe0; margin: 0 .25em 0 0; } .date select:focus { background: #fff; }
SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date label { position: absolute; left: -999em; }
SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend> <span> Post Date </span> </legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date { border: 0; padding: 0; position: relative; } .date legend span { display: block; line-height: 1.6; text-align: right; width: 120px; position: absolute; top: 0;  left: 0; }
SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend><span>Post Date</span></legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date legend  span:after { content: &quot;:&quot;; }
COMPLEX FORM: RELATED FIELDS
COMPLEX FORM: RELATED FIELDS Organization and coordination as with other elements, form components can have multiple  CLASS ifications < fieldset  class = &quot;radio related&quot; > < legend >   < span > Confine results to </ span >   </ legend > < ul > < li > <!-- year --> </ li > < li > <!-- month --> </ li > < li > <!-- range --> </ li > </ ul > </ fieldset >
COMPLEX FORM: RELATED FIELDS Basic implicit  LABEL nothing shocking here <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> < label > < input  type = &quot;radio&quot;  name = &quot;confines&quot;   value = &quot;year&quot;  />   within the last year   </ label > </li> ... </ul> </fieldset>
COMPLEX FORM: RELATED FIELDS In a slight bending of the rules, implicit  LABEL s  can  contain more than one form control in our case, a radio  INPUT  as well as a  SELECT ion box <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <label><input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;year&quot; />   within the last year</label> </li> <li> < label > < input  type = &quot;radio&quot;  name = &quot;confines&quot;   value = &quot;month&quot;  />   the month of < select  name = &quot;month&quot; > < option  value = &quot;01&quot; > January </ option > ... < option  value = &quot;12&quot; > December </ option > </ select > </ label > </li> ... </ul> </fieldset>
COMPLEX FORM: RELATED FIELDS How do I code that?!? think about it... what are the relationships of the fields? <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> ... <li> < dl > < dt > <!-- radio will go here --> </ dt > < dd > <!-- related fields here --> </ dd > </ dl > </li> </ul> </fieldset>
COMPLEX FORM: RELATED FIELDS We know the first bit <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> ... <li> <dl> <dt> < label >   < input  type = &quot;radio&quot;  name = &quot;confines&quot;   value = &quot;range&quot;  /> a monthly range   </ label > </dt> <dd> <!-- related fields here --> </dd> </dl> </li> </ul> </fieldset>
COMPLEX FORM: RELATED FIELDS We need to organize this now <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> ... <li> <dl> <dt> <label><input type=&quot;radio&quot; name=&quot;confines&quot;... </dt> <dd> < ol > < li > <!-- start --> </ li > < li > <!-- end --> </ li > </ ol > </dd> </dl> </li> </ul> </fieldset>
COMPLEX FORM: RELATED FIELDS Simple explicit  LABEL ... <dd> <ol> <li> < label  for = &quot;range-start&quot; >   from the start of </ label > < select  id = &quot;range-start&quot;    name = &quot;range-start&quot; > < option  value = &quot;2006-01&quot; > January   2006 </ option > ... < option  value = &quot;2006-12&quot; > December   2006 </ option > </ select > </li> <li> <!-- end --> </li> ... </ol> </dd> ...
COMPLEX FORM: RELATED FIELDS And again ... <dd> <ol> <li> <label for=&quot;range-start&quot;>from the start of</label> ... </li> <li> < label  for = &quot;range-end&quot; >   until the end of </ label > < select  id = &quot;range-end&quot;    name = &quot;range-end&quot; > < option  value = &quot;2006-01&quot; > January   2006 </ option > ... < option  value = &quot;2006-12&quot; > December   2006 </ option > </ select > </li> </ol> </dd> ...
COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <label> <input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;year&quot; /> within the last year</label> </li> <li> <label> <input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;month&quot; /> the month of <select name=&quot;month&quot;> <option value=&quot;01&quot;>January</option> ... </select> </label> </li> <li> <dl> <dt> <label> <input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;range&quot; /> a monthly range </label> </dt> <dd> <ol> <li> <label for=&quot;range-start&quot;>from the start of</label> <select id=&quot;range-start&quot; name=&quot;range-start&quot;> <option value=&quot;2006-01&quot;>January 2006</option> ... </select> </li> <li> <label for=&quot;range-end&quot;>until the end of</label> <select id=&quot;range-end&quot; name=&quot;range-end&quot;> <option value=&quot;2006-01&quot;>January 2006</option> ... </select> </li> </ol> </dd> </dl> </li> </ul> </fieldset> Itʼs a lot of code...
COMPLEX FORM: RELATED FIELDS ...but the benefits are worth it Confine results to List of three items   bullet   Radio button (not checked) within the last year   bullet   Radio button (not checked) the month of    Combo box January   bullet   Definition list of one item   Radio button (not checked) a monthly range   equals   List of two items   one: from the start of   Combo box January 2006   two: until the end of   Combo box January 2006   List end   List end List end transcribed by Fangs
COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> /* We'll save some space   and inherit styles   from .radio */ form ol, form ul, form dl  { list-style: none; margin: 0; padding: 0; } li ul, li ol { font-size: 1em; }
COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> .related li { clear: both; float: none; margin: 0 0 .5em; width: auto; } /* For IE to recover from   a strange margin */ .related li { zoom: 1; }
COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> .related select { margin-left: .25em; } .related dd { margin: .5em 0 0; padding: 0 0 0 3em; } .related dd label { float: left; line-height: 1.9; width: 100px; }
COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> .related legend span { display: block; line-height: 1.8; text-align: right; width: 120px; position: absolute; top: 0; left: -130px; }
MAKING MESSAGES THE   MOST   OF
MESSAGING: REQUIRED
MESSAGING: REQUIRED What is the * anyway? Well, it stands for something else and in HTML, the closest to that we have to convey that is the  ABBR  element. <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p> Required fields are marked    <abbr   title = &quot;required&quot; > * </abbr> . </p> <ol> <li>   <label for=&quot;contact-name&quot;>   Name < abbr  title = &quot;required&quot; > * </ abbr >   </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; />   </li> ...
MESSAGING: REQUIRED If you want to go all-out, you can but that seems like overkill <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p> Required fields are marked    <em><abbr   title = &quot;required&quot; > * </abbr></em>.   </p> <ol> <li  class = &quot;required&quot; >   <label for=&quot;contact-name&quot;>   Name <em>< abbr  title = &quot;required&quot; > *   </ abbr ></em>   </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; />   </li> ...
MESSAGING: REQUIRED <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p>Required fields are marked    <abbr title=&quot;required&quot;>*</abbr>.</p> <ol> <li>   <label for=&quot;contact-name&quot;>   Name<abbr title=&quot;required&quot;>*</abbr>   </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; />   </li> ...
MESSAGING: REQUIRED <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p>Required fields are marked    <abbr title=&quot;required&quot;>*</abbr>.</p> <ol> <li>   <label for=&quot;contact-name&quot;>   Name<abbr title=&quot;required&quot;>*</abbr>   </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; />   </li> ... abbr { cursor: help; font-style: normal; border: 0; }
MESSAGING: FORMATTING
MESSAGING: FORMATTING How should we emphasize important formatting info? ... <li> <label for=&quot;contact-email&quot;>   Email<abbr title=&quot;required&quot;>*</abbr>   </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> <li> <label  for = &quot;contact-phone&quot; > Phone <em    class = &quot;msg&quot; >  format: 123-456-7890 </em>   </label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; />   </li> <li>   <label for=&quot;contact-subject&quot;>   Subject<abbr title=&quot;required&quot;>*</abbr>   </label> <select id=&quot;contact-subject&quot; name=&quot;subject&quot;> <option value=&quot;Error&quot;>I noticed a website error</option>   ...
MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em    class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; />   </li> ...
MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em    class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; />   </li> ... label em.msg { font-size: .8em; font-style: normal; line-height: 2.5; }
MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em    class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; />   </li> ... label{ ... position: relative; } label em.msg { color: #aaa; font-size: .8em; font-style: normal; line-height: 2.5; position: absolute; right: -266px; top: 0; }
MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em    class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; />   </li> ...
MESSAGING: ERRORS
MESSAGING: ERRORS How should we strongly emphasize even more important error advisories? How should we highlight the field? ... <li   class = &quot;error&quot; > <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr>   < strong  class = &quot;err&quot; >  You forgot to fill   in your email </ strong > </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ...
MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot   to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ...
MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot   to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ... strong.err { color: #ffdfdf; display: block; padding-left: 5px; text-align: left; }
MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot   to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ... strong.err { color: #ffdfdf; display: block; line-height: 1.8; padding-left: 5px; text-align: left; white-space: nowrap; position: absolute; top: 0; left: 390px; } strong.err:before { content: &quot;<&quot; }
MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot   to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ... .error input { border: 2px solid #b00; background: #ffdfdf; } .error input:focus { background: #fff; }
MESSAGING: ERRORS How do we notify users of errors? It is best to be upfront about errors encountered and to say, in plain language, what the user needs to do to fix it and linking to the field with errors doesn't hurt <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> < div  id = &quot;errors&quot; > < p > We encountered  < strong > 1 error </ strong >   while trying to process this form: </ p > < ol > < li > You forgot to include  < a   href = &quot;#contact-email&quot; > your email   address </ a ></ li > </ ol > </ div > <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ...
MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process   this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email   address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ...
MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process   this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email   address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ... #errors { background: #ffdfdf; border: 2px solid #b00; color: #333; margin: .5em 0 1em; padding: 10px; }
MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process   this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email   address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ... #errors p { margin: 0; padding: 0; } #errors ol { list-style: disc; margin: 0 0 0 20px; }
MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process   this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email   address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ... #errors a { color: #b00; }
PARTING ADVICE • treat forms like any other piece of (X)HTML • be aware of browser inconsistencies & make accommodations (when possible) • break a complex form into bite-size chunks • look for ways to provide richer meaning/a better experience • apply your CSS layout knowledge for the rest of the page to a form • don't over-complicate form design • learn to love forms
FORMS ARE NOT NECESSARILY EVIL
http://slideshare.net/AaronGustafson

Mais conteúdo relacionado

Mais procurados

software Engineering process
software Engineering processsoftware Engineering process
software Engineering processRaheel Aslam
 
Boundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptxBoundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptxlandesc
 
Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________Gelis Wu
 
Negatieve getallen havo
Negatieve getallen havoNegatieve getallen havo
Negatieve getallen havosvanboxel
 
IM02: Database Language
IM02: Database LanguageIM02: Database Language
IM02: Database LanguageKelvin Chan
 
Padrões-03 - Padrões Arquiteturais - Pipes e Filtros
Padrões-03 - Padrões Arquiteturais - Pipes e FiltrosPadrões-03 - Padrões Arquiteturais - Pipes e Filtros
Padrões-03 - Padrões Arquiteturais - Pipes e FiltrosEduardo Nicola F. Zagari
 
Normalization of Data Base
Normalization of Data BaseNormalization of Data Base
Normalization of Data BaseRavinder Kamboj
 
Code refactoring
Code refactoringCode refactoring
Code refactoringLalit Kale
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?CPD INDIA
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles sathish sak
 
Lecture-5-Requirements Analysis and Specification.pptx
Lecture-5-Requirements Analysis and Specification.pptxLecture-5-Requirements Analysis and Specification.pptx
Lecture-5-Requirements Analysis and Specification.pptxYaseenNazir3
 
Software Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptxubaidullah75790
 
SOFTWARE QUALITY ASSURANCE.ppt
SOFTWARE QUALITY ASSURANCE.pptSOFTWARE QUALITY ASSURANCE.ppt
SOFTWARE QUALITY ASSURANCE.pptDrTThendralCompSci
 
Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut iiplarsen67
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGSaqib Raza
 
300+ top database management system questions and answers 2020
300+ top database management system questions and answers 2020300+ top database management system questions and answers 2020
300+ top database management system questions and answers 2020tadeseguchi
 

Mais procurados (20)

software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
 
Boundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptxBoundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptx
 
Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________
 
Negatieve getallen havo
Negatieve getallen havoNegatieve getallen havo
Negatieve getallen havo
 
IM02: Database Language
IM02: Database LanguageIM02: Database Language
IM02: Database Language
 
Padrões-03 - Padrões Arquiteturais - Pipes e Filtros
Padrões-03 - Padrões Arquiteturais - Pipes e FiltrosPadrões-03 - Padrões Arquiteturais - Pipes e Filtros
Padrões-03 - Padrões Arquiteturais - Pipes e Filtros
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
Princípios SOLID
Princípios SOLIDPrincípios SOLID
Princípios SOLID
 
Normalization of Data Base
Normalization of Data BaseNormalization of Data Base
Normalization of Data Base
 
Introduction to RDBMS
Introduction to RDBMSIntroduction to RDBMS
Introduction to RDBMS
 
Code refactoring
Code refactoringCode refactoring
Code refactoring
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles
 
Lecture-5-Requirements Analysis and Specification.pptx
Lecture-5-Requirements Analysis and Specification.pptxLecture-5-Requirements Analysis and Specification.pptx
Lecture-5-Requirements Analysis and Specification.pptx
 
Software Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptx
 
SOFTWARE QUALITY ASSURANCE.ppt
SOFTWARE QUALITY ASSURANCE.pptSOFTWARE QUALITY ASSURANCE.ppt
SOFTWARE QUALITY ASSURANCE.ppt
 
Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut ii
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERING
 
300+ top database management system questions and answers 2020
300+ top database management system questions and answers 2020300+ top database management system questions and answers 2020
300+ top database management system questions and answers 2020
 
Verification & Validation
Verification & ValidationVerification & Validation
Verification & Validation
 

Destaque

Best Practices for Form Design
Best Practices for Form DesignBest Practices for Form Design
Best Practices for Form DesignSimone Ravaioli
 
The ultimate guide to employee referrals
The ultimate guide to employee referralsThe ultimate guide to employee referrals
The ultimate guide to employee referralsAchievers
 
Mello anthony despierta charlas sobre la espiritualidad [doc]
Mello anthony   despierta charlas sobre la espiritualidad [doc]Mello anthony   despierta charlas sobre la espiritualidad [doc]
Mello anthony despierta charlas sobre la espiritualidad [doc]Mario Paternina
 
De Reis van de Heldin december 2015
De Reis van de Heldin december 2015De Reis van de Heldin december 2015
De Reis van de Heldin december 2015Peter de Kuster
 
Error messages
Error messagesError messages
Error messagesrtinkelman
 
Gfpi f-019 guia de aprendizaje 01 tda orientar fpi
Gfpi f-019 guia de aprendizaje 01 tda orientar fpiGfpi f-019 guia de aprendizaje 01 tda orientar fpi
Gfpi f-019 guia de aprendizaje 01 tda orientar fpilisbet bravo
 
Análisis situacional integral de salud final
 Análisis situacional integral de salud final Análisis situacional integral de salud final
Análisis situacional integral de salud finalEstefanía Echeverría
 
JULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de NegociosJULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de NegociosJulio Pari
 
Onderzoeksrapport acrs v3.0_definitief
Onderzoeksrapport acrs v3.0_definitiefOnderzoeksrapport acrs v3.0_definitief
Onderzoeksrapport acrs v3.0_definitiefrloggen
 
Como hacer un plan de negocios
Como hacer un plan de negociosComo hacer un plan de negocios
Como hacer un plan de negociosXPINNERPablo
 
Schrijven voor het web
Schrijven voor het webSchrijven voor het web
Schrijven voor het webSimone Levie
 
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA... ..
 
Estrategias competitivas básicas
Estrategias competitivas básicasEstrategias competitivas básicas
Estrategias competitivas básicasLarryJimenez
 

Destaque (20)

Best Practices for Form Design
Best Practices for Form DesignBest Practices for Form Design
Best Practices for Form Design
 
The ultimate guide to employee referrals
The ultimate guide to employee referralsThe ultimate guide to employee referrals
The ultimate guide to employee referrals
 
Mello anthony despierta charlas sobre la espiritualidad [doc]
Mello anthony   despierta charlas sobre la espiritualidad [doc]Mello anthony   despierta charlas sobre la espiritualidad [doc]
Mello anthony despierta charlas sobre la espiritualidad [doc]
 
Estrategias de porter
Estrategias de porterEstrategias de porter
Estrategias de porter
 
De Reis van de Heldin december 2015
De Reis van de Heldin december 2015De Reis van de Heldin december 2015
De Reis van de Heldin december 2015
 
"Protección de la salud mental luego del terremoto y tsunami del 27 de febrer...
"Protección de la salud mental luego del terremoto y tsunami del 27 de febrer..."Protección de la salud mental luego del terremoto y tsunami del 27 de febrer...
"Protección de la salud mental luego del terremoto y tsunami del 27 de febrer...
 
Error messages
Error messagesError messages
Error messages
 
Gfpi f-019 guia de aprendizaje 01 tda orientar fpi
Gfpi f-019 guia de aprendizaje 01 tda orientar fpiGfpi f-019 guia de aprendizaje 01 tda orientar fpi
Gfpi f-019 guia de aprendizaje 01 tda orientar fpi
 
Análisis situacional integral de salud final
 Análisis situacional integral de salud final Análisis situacional integral de salud final
Análisis situacional integral de salud final
 
Geheugen verbeteren
Geheugen verbeterenGeheugen verbeteren
Geheugen verbeteren
 
JULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de NegociosJULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de Negocios
 
De impact van adhd
De impact van adhdDe impact van adhd
De impact van adhd
 
PMP Sonora Saludable 2010 2015
PMP Sonora Saludable 2010   2015  PMP Sonora Saludable 2010   2015
PMP Sonora Saludable 2010 2015
 
Tears In The Rain
Tears In The RainTears In The Rain
Tears In The Rain
 
Onderzoeksrapport acrs v3.0_definitief
Onderzoeksrapport acrs v3.0_definitiefOnderzoeksrapport acrs v3.0_definitief
Onderzoeksrapport acrs v3.0_definitief
 
Como hacer un plan de negocios
Como hacer un plan de negociosComo hacer un plan de negocios
Como hacer un plan de negocios
 
Schrijven voor het web
Schrijven voor het webSchrijven voor het web
Schrijven voor het web
 
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
 
Estrategias competitivas básicas
Estrategias competitivas básicasEstrategias competitivas básicas
Estrategias competitivas básicas
 
Cápsula 1. estudios de mercado
Cápsula 1. estudios de mercadoCápsula 1. estudios de mercado
Cápsula 1. estudios de mercado
 

Mais de Aaron Gustafson

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Aaron Gustafson
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Aaron Gustafson
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Aaron Gustafson
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Aaron Gustafson
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Aaron Gustafson
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Aaron Gustafson
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Aaron Gustafson
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Aaron Gustafson
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Aaron Gustafson
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]Aaron Gustafson
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Aaron Gustafson
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Aaron Gustafson
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Aaron Gustafson
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for EveryoneAaron Gustafson
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Aaron Gustafson
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Aaron Gustafson
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Aaron Gustafson
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Aaron Gustafson
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Aaron Gustafson
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Aaron Gustafson
 

Mais de Aaron Gustafson (20)

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for Everyone
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]
 

Learning To Love Forms (Web Directions South '07)

  • 1.  
  • 2. AARON GUSTAFSON EASY! DESIGNS, LLC
  • 3. FORMS ARE A NECESSARY EVIL
  • 5. SIMPLE FORM: CONTACT US < form id = &quot;contact-form&quot; action = &quot;/action-page.php&quot; method = &quot;post&quot; > <!-- the rest of our form will go here --> </ form > FORM Element establishes a form ACTION is the only required attribute and should always be a URI METHOD defaults to “get” NAME is depreciated; use ID instead
  • 6. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> < fieldset > <legend> Send us a message </legend> <!-- the rest of our form will go here --> </ fieldset > </form> FIEDSET Element used to group related fields LEGEND Element used to provide a caption for a FIELDSET
  • 7. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset> <legend> Send us a message </legend> < p > <!-- form control --> </ p > < p > <!-- form control --> </ p > < p > <!-- form control --> </ p > </fieldset> </form> Containing FORM Controls P or DIV sensible choices, but not very accurate (except in certain instances) OL or UL most forms are lists of questions or form controls, so these are better <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset> <legend> Send us a message </legend> < ol > < li > <!-- form control --> </ li > < li > <!-- form control --> </ li > < li > <!-- form control --> </ li > </ ol > </fieldset> </form>
  • 8. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li> Name < input type = &quot;text&quot; name = &quot;name&quot; id = &quot;contact-name&quot; /> </li> <li> Email < input type = &quot;text&quot; name = &quot;email&quot; id = &quot;contact-email&quot; /> </li> <li> <!-- form control --> </li> </ol> </fieldset> </form> INPUT Text Control type= &quot;name&quot; is a basic text input field (also type= &quot;password&quot; for content you want hidden) NAME vs. ID NAME is for the back end ID is for the front end
  • 9. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li>Name <input type=&quot;text&quot; name=&quot;name&quot; id=&quot;contact-name&quot; /></li> <li>Email <input type=&quot;text&quot; name=&quot;email&quot; id=&quot;contact-email&quot; /></li> <li> Message < textarea name = &quot;message&quot; id = &quot;contact-message&quot; rows = &quot;4&quot; cols = &quot;30&quot; > </ textarea > </li> </ol> </fieldset> </form> TEXTAREA a multiline text form control requires ROWS and COLS attributes!!!
  • 10. SIMPLE FORM: CONTACT US Working with LABEL this element provides to means of associating its content with a form control: implicit association LABEL wraps the form control and the text explicit association LABEL 's FOR attribute is an ID reference to the form control <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset> <legend> Send us a message </legend> <ol> <li> < label for = &quot;contact-name&quot; > Name </ label> < input id = &quot;contact-name&quot; ... /> </li> ... </ol> </fieldset> </form> <form id=&quot;contact-form&quot; action=&quot;/action-page.php&quot; method=&quot;post&quot;> <fieldset> <legend> Send us a message </legend> <ol> <li> < label > Name < input ... /></ label> </li> ... </ol> </fieldset> </form>
  • 11. SIMPLE FORM: CONTACT US Buttons trigger events in a form; use either INPUT or BUTTON element Common TYPE s submit – submits the form; default button type reset – resets all form control values back to their defaults when the page loaded <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... </ol> <button type = &quot;submit&quot; > Go </button> </fieldset> </form> <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... </ol> <input type = &quot;submit&quot; value = &quot;Go&quot; / > </fieldset> </form>
  • 12. SIDEBAR : BUTTONS WINDOWS XP OS X BUTTON INPUT Mozilla IE 6/7 (XP) IE 6/7 (classic) Opera Opera IE 5 Firefox Camino Safari
  • 13. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
  • 14. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> body { font: 62.5% &quot;Lucida Sans Unicode&quot;, &quot;Lucida Grande&quot;, sans-serif; } ol, ul, p { font-size: 1.2em; line-height: 1.5; }
  • 15. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> form, fieldset, legend { border: 0; padding: 0; margin: 0; } legend { font-size: 2em; } form ol, form ul { list-style: none; margin: 0; padding: 0; }
  • 16. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> form li { margin: 0 0 .75em; } label { display: block; } input, textarea { width: 250px; }
  • 17. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> form li { clear: both; margin: 0 0 .75em; padding: 0; } label { display: block; float: left; line-height: 1.6; margin-right: 10px; text-align: right; width: 120px; }
  • 18. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> legend { font-size: 2em; line-height: 1.8; padding-bottom: .5em; } button { margin-left: 130px; cursor: pointer; }
  • 19. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> <li><label for=&quot;contact-name&quot;>Name</label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /></li> <li><label for=&quot;contact-email&quot;>Email</label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /></li> <li><label for=&quot;contact-message&quot;>Message</label> <textarea id=&quot;contact-message&quot; name=&quot;message&quot; rows=&quot;4&quot; cols=&quot;30&quot;></textarea></li> </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> label:after { content: ':'; } input, textarea { background: #ddd; width: 250px; } input:focus, textarea:focus { background: #fff; } /* Some styles to get the baselines to match & to unify the type used */
  • 20. SIMPLE FORM: CONTACT US body { font: 62.5% &quot;Lucida Sans Unicode&quot;, &quot;Lucida Grande&quot;, sans-serif; } ol, ul, p { font-size: 1.2em; line-height: 1.5; } form, fieldset, legend { border: 0; margin: 0; padding: 0; } legend { font-size: 2em; line-height: 1.8; padding-bottom: .5em; } form ol, form ul { list-style: none; margin: 0; padding: 0; } form li { clear: both; margin: 0 0 .75em; padding: 0; } label { display: block; float: left; line-height: 1.6; margin-right: 10px; text-align: right; width: 120px; } label:after { content: ':'; } input, textarea { background: #ddd; font: 1em Arial, Helvetica, sans-serif; padding: 1px 3px; width: 250px; } textarea { line-height: 1.3em; padding: 0 3px; } input:focus, textarea:focus { background: #fff; } button { background: #ffd100; border: 2px outset #333; color: #333; cursor: pointer; font-size: .9em; font-weight: bold; letter-spacing: .3em; margin-left: 130px; padding: .2em .5em; text-transform: uppercase; }
  • 22. SIMPLE FORM: CONTACT US SELECT ion Lists allows selection of one or more OPTION s On OPTION elements, the VALUE attribute is optional (contents are submitted by default) <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li>< label for = &quot;contact-subject&quot; > Subject </ label > < select id = &quot;contact-subject&quot; name = &quot;subject&quot; > < option value = &quot;Error&quot; > I noticed a website error </ option > < option value = &quot;Question&quot; > I have a question </ option > < option > Other </ option > </ select ></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
  • 23. SIDEBAR: OPTGROUPS < select id = &quot;favorite-fruit&quot; name = &quot;favorite-fruit&quot; > < optgroup label = &quot;Apples&quot; > < option value = &quot;Golden Delicious Apples&quot; > Golden Delicious </ option > < option value = &quot;Granny Smith Apples&quot; > Granny Smith </ option > < option value = &quot;Macintosh Apples&quot; > Macintosh </ option > < option value = &quot;Red Delicious Apples&quot; > Red Delicious </ option > </ optgroup > < optgroup label = &quot;Berries&quot; > < option > Blackberries </ option > < option > Blueberries </ option > < option > Raspberries </ option > < option > Strawberries </ option > </ optgroup > </ select >
  • 24. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li> <label for=&quot;contact-subject&quot;>Subject</label> <select id=&quot;contact-subject&quot; name=&quot;subject&quot;> <option value=&quot;Error&quot;>I noticed a website error</option> <option value=&quot;Question&quot;>I have a question</option> <option>Other</option> </select> </li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
  • 25. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li> <label for=&quot;contact-subject&quot;>Subject</label> <select id=&quot;contact-subject&quot; name=&quot;subject&quot;> <option value=&quot;Error&quot;>I noticed a website error</option> <option value=&quot;Question&quot;>I have a question</option> <option>Other</option> </select> </li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> select { background: #ddd; width: 260px; /* width is *usually* the input width + input padding + 4px */ } input:focus, textarea:focus , select:focus { background: #fff; }
  • 26. SIDEBAR : SELECTS WINDOWS XP OS X Mozilla IE 7 (classic) IE 6/7 (XP) IE 6 (classic) Opera Opera IE 5 Firefox Camino Safari
  • 28. SIMPLE FORM: CONTACT US Nested FIELDSET s a great way to organize radio or checkbox groups The LEGEND is the question or statement Lists organize the possible responses ( OL or UL ) implicit LABEL s provide an easy way to style in IE6 ... < li > < fieldset class = &quot;radio&quot; > < legend > I would prefer to be contacted by </ legend > < ul > < li >< label >< input type = &quot;radio&quot; name = &quot;method&quot; value = &quot;email&quot; /> email </ label ></ li > < li >< label >< input type = &quot;radio&quot; name = &quot;method&quot; value = &quot;phone&quot; /> phone </ label ></ li > </ ul > </ fieldset > </ li > ...
  • 29. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; /> email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; /> phone</label></li> </ul> </fieldset> </li> ... </form>
  • 30. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; /> email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; /> phone</label></li> </ul> </fieldset> </li> ... </form> .radio legend { font-size: 1em; line-height: 1.5; padding: 0 0 0 6px; margin: 0; } .radio label { display: inline; width: auto; margin: 0; }
  • 31. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; /> email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; /> phone</label></li> </ul> </fieldset> </li> ... </form> .radio { margin-left: 125px; } .radio ul { font-size: 1em; margin: .3em 0 0; } .radio label:after { content: ''; } label input { background: transparent; width: auto; }
  • 32. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> ... <li> <fieldset class=&quot;radio&quot;> <legend>I would prefer to be contacted by</legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; /> email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; /> phone</label></li> </ul> </fieldset> </li> ... </form> .radio li { float: left; margin: 0; width: 48%; clear: none; } label input { width: auto; position: relative; top: 2px; }
  • 33. SIMPLE FORM: CONTACT US .radio legend { font-size: 1em; line-height: 1.5; padding: 0 0 0 6px; margin: 0; max-width: 270px; width: 270px; } ... <fieldset class=&quot;radio&quot;> <legend> This is an exceedingly long < code > LEGEND </ code > to demonstrate the odd behavior of < code > LEGEND </ code > s </legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; /> email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; /> phone</label></li> </ul> </fieldset> ...
  • 34. SIMPLE FORM: CONTACT US .radio legend span { display: block; width: 270px; } ... <fieldset class=&quot;radio&quot;> <legend> <span> This is an exceedingly long <code>LEGEND</code> to demonstrate the odd behavior of <code>LEGEND</code>s </ span > </legend> <ul> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;email&quot; /> email</label></li> <li><label><input type=&quot;radio&quot; name=&quot;method&quot; value=&quot;phone&quot; /> phone</label></li> </ul> </fieldset> ...
  • 36. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... < li class = &quot;confirm&quot; > < input type = &quot;hidden&quot; name = &quot;mailing-list&quot; value = &quot;0&quot; /> < label >< input type = &quot;checkbox&quot; name = &quot;mailing-list&quot; value = &quot;1&quot; /> Please add me to your mailing list </ label ></ li > ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form> Confirmations a little CLASS ification goes a long way
  • 37. SIMPLE FORM: CONTACT US <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li class=&quot;confirm&quot;> <input type=&quot;hidden&quot; name=&quot;mailing-list&quot; value=&quot;0&quot; /> <label><input type=&quot;checkbox&quot; name=&quot;mailing-list&quot; value=&quot;1&quot; /> Please add me to your mailing list</label></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
  • 38. SIMPLE FORM: CONTACT US .confirm label { display: block; float: none; margin-left: 125px; text-align: left; width: 270px; } <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li class=&quot;confirm&quot;> <input type=&quot;hidden&quot; name=&quot;mailing-list&quot; value=&quot;0&quot; /> <label><input type=&quot;checkbox&quot; name=&quot;mailing-list&quot; value=&quot;1&quot; /> Please add me to your mailing list</label></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
  • 39. SIMPLE FORM: CONTACT US .confirm { margin-bottom: 1.4em; } .radio label:after , .confirm label:after { content: ''; } <form id=&quot;contact-form&quot; action=&quot;#&quot; method=&quot;post&quot;> <fieldset> <legend>Send us a message</legend> <ol> ... <li class=&quot;confirm&quot;> <input type=&quot;hidden&quot; name=&quot;mailing-list&quot; value=&quot;0&quot; /> <label><input type=&quot;checkbox&quot; name=&quot;mailing-list&quot; value=&quot;1&quot; /> Please add me to your mailing list</label></li> ... </ol> <button type=&quot;submit&quot;>Go</button> </fieldset> </form>
  • 42. SIMPLE FORM: SEARCH BOX POST vs. GET Search forms are traditionally GET requests to allow the action page (i.e. the results) to be bookmarkable. < form id = &quot;search-form&quot; action = &quot;/action-page.php&quot; method = &quot;get&quot; > <!-- the rest of our form will go here --> </ form >
  • 43. SIMPLE FORM: SEARCH BOX You need something Sometimes a FIELDSET is unnecessary, but in XHTML, you need something to wrap the contents of a form <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <!-- the rest of our form will go here --> <p> </form>
  • 44. SIMPLE FORM: SEARCH BOX Easy-peasy <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> < label for = &quot;search-query&quot; > Search this site for </ label > < input type = &quot;text&quot; id = &quot;search-query&quot; name = &quot;query&quot; /> <p> </form>
  • 45. SIMPLE FORM: SEARCH BOX It’s a BUTTON big shock, I know <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> < button type = &quot;submit&quot; > Go </ button > <p> </form>
  • 46. SIMPLE FORM: SEARCH BOX <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> <button type=&quot;submit&quot;>Go</button> <p> </form> body { background: #54af44; font: 62.5% &quot;Lucida Sans Unicode&quot;, &quot;Lucida Grande&quot;, sans-serif; } ol, ul, p { font-size: 1.2em; line-height: 1.5; }
  • 47. SIMPLE FORM: SEARCH BOX <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> <button type=&quot;submit&quot;>Go</button> <p> </form> label { line-height: 2em; } input { border: 1px solid #c00; background: #ebebeb; margin: 0 .5em; padding: 2px 4px; } input:focus { background: #fff; }
  • 48. SIMPLE FORM: SEARCH BOX <form id=&quot;search-form&quot; action=&quot;/action-page.php&quot; method=&quot;get&quot;> <p> <label for=&quot;search-query&quot;>Search this site for</label> <input type=&quot;text&quot; id=&quot;search-query&quot; name=&quot;query&quot; /> <button type=&quot;submit&quot;>Go</button> <p> </form> button { background: #c00; border: 0; color: #fff; cursor: pointer; font-size: .9em; font-weight: bold; letter-spacing: .1em; padding: 2px 8px; text-transform: uppercase; }
  • 50. SIMPLE FORM: DATE SELECT Getting organized < fieldset class = &quot;date&quot; > <!-- the rest will go here --> </ fieldset >
  • 51. SIMPLE FORM: DATE SELECT Not really a LABEL <fieldset class=&quot;date&quot;> < legend > Post Date </ legend > <!-- the rest will go here --> </fieldset>
  • 52. SIMPLE FORM: DATE SELECT Not just a SELECT we need some LABEL ing <fieldset class=&quot;date&quot;> <legend>Post Date</legend> < ol > < li > < label for = &quot;date-day&quot; > Date </ label > < select id = &quot;date-day&quot; name = &quot;day&quot; > < option > 01 </ option > ... < option > 31 </ option > </ select > </ li > </ ol > </fieldset>
  • 53. SIMPLE FORM: DATE SELECT And so on <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li> <label for=&quot;date-day&quot;>Date</label> ... </li> < li > < label for = &quot;date-month&quot; > Month </ label > < select id = &quot;date-month&quot; name = &quot;month&quot; > < option value = &quot;01&quot; > January </ option > ... < option value = &quot;12&quot; > December </ option > </ select > </ li > </ ol > </ fieldset >
  • 54. SIMPLE FORM: DATE SELECT And so forth <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li> <label for=&quot;date-day&quot;>Date</label> ... </li> <li> <label for=&quot;date-month&quot;>Month</label> ... </li> < li > < label for = &quot;date-year&quot; > Year </ label > < select id = &quot;date-year&quot; name = &quot;year&quot; > < option > 2007 </ option > < option > 2008 </ option > </ select > </ li > </ol> </fieldset>
  • 55. SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> body { background: #54af44; font: 62.5% &quot;Lucida Sans Unicode&quot;, &quot;Lucida Grande&quot;, sans-serif; } ol, ul, p, legend { font-size: 1.2em; line-height: 1.5; } legend { color: #000; }
  • 56. SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date { border: 0; padding: 0; } .date ol { list-style: none; margin: 0 0 0 130px; padding: 0; }
  • 57. SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date li { float: left; }
  • 58. SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date select { background: #e2efe0; margin: 0 .25em 0 0; } .date select:focus { background: #fff; }
  • 59. SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend>Post Date</legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date label { position: absolute; left: -999em; }
  • 60. SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend> <span> Post Date </span> </legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date { border: 0; padding: 0; position: relative; } .date legend span { display: block; line-height: 1.6; text-align: right; width: 120px; position: absolute; top: 0; left: 0; }
  • 61. SIMPLE FORM: DATE SELECT <fieldset class=&quot;date&quot;> <legend><span>Post Date</span></legend> <ol> <li><label for=&quot;date-day&quot;>Date</label> ... </li> <li><label for=&quot;date-month&quot;>Month</label> ... </li> <li><label for=&quot;date-year&quot;>Year</label> ... </li> </ol> </fieldset> .date legend span:after { content: &quot;:&quot;; }
  • 63. COMPLEX FORM: RELATED FIELDS Organization and coordination as with other elements, form components can have multiple CLASS ifications < fieldset class = &quot;radio related&quot; > < legend > < span > Confine results to </ span > </ legend > < ul > < li > <!-- year --> </ li > < li > <!-- month --> </ li > < li > <!-- range --> </ li > </ ul > </ fieldset >
  • 64. COMPLEX FORM: RELATED FIELDS Basic implicit LABEL nothing shocking here <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> < label > < input type = &quot;radio&quot; name = &quot;confines&quot; value = &quot;year&quot; /> within the last year </ label > </li> ... </ul> </fieldset>
  • 65. COMPLEX FORM: RELATED FIELDS In a slight bending of the rules, implicit LABEL s can contain more than one form control in our case, a radio INPUT as well as a SELECT ion box <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <label><input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;year&quot; /> within the last year</label> </li> <li> < label > < input type = &quot;radio&quot; name = &quot;confines&quot; value = &quot;month&quot; /> the month of < select name = &quot;month&quot; > < option value = &quot;01&quot; > January </ option > ... < option value = &quot;12&quot; > December </ option > </ select > </ label > </li> ... </ul> </fieldset>
  • 66. COMPLEX FORM: RELATED FIELDS How do I code that?!? think about it... what are the relationships of the fields? <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> ... <li> < dl > < dt > <!-- radio will go here --> </ dt > < dd > <!-- related fields here --> </ dd > </ dl > </li> </ul> </fieldset>
  • 67. COMPLEX FORM: RELATED FIELDS We know the first bit <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> ... <li> <dl> <dt> < label > < input type = &quot;radio&quot; name = &quot;confines&quot; value = &quot;range&quot; /> a monthly range </ label > </dt> <dd> <!-- related fields here --> </dd> </dl> </li> </ul> </fieldset>
  • 68. COMPLEX FORM: RELATED FIELDS We need to organize this now <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> ... <li> <dl> <dt> <label><input type=&quot;radio&quot; name=&quot;confines&quot;... </dt> <dd> < ol > < li > <!-- start --> </ li > < li > <!-- end --> </ li > </ ol > </dd> </dl> </li> </ul> </fieldset>
  • 69. COMPLEX FORM: RELATED FIELDS Simple explicit LABEL ... <dd> <ol> <li> < label for = &quot;range-start&quot; > from the start of </ label > < select id = &quot;range-start&quot; name = &quot;range-start&quot; > < option value = &quot;2006-01&quot; > January 2006 </ option > ... < option value = &quot;2006-12&quot; > December 2006 </ option > </ select > </li> <li> <!-- end --> </li> ... </ol> </dd> ...
  • 70. COMPLEX FORM: RELATED FIELDS And again ... <dd> <ol> <li> <label for=&quot;range-start&quot;>from the start of</label> ... </li> <li> < label for = &quot;range-end&quot; > until the end of </ label > < select id = &quot;range-end&quot; name = &quot;range-end&quot; > < option value = &quot;2006-01&quot; > January 2006 </ option > ... < option value = &quot;2006-12&quot; > December 2006 </ option > </ select > </li> </ol> </dd> ...
  • 71. COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <label> <input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;year&quot; /> within the last year</label> </li> <li> <label> <input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;month&quot; /> the month of <select name=&quot;month&quot;> <option value=&quot;01&quot;>January</option> ... </select> </label> </li> <li> <dl> <dt> <label> <input type=&quot;radio&quot; name=&quot;confines&quot; value=&quot;range&quot; /> a monthly range </label> </dt> <dd> <ol> <li> <label for=&quot;range-start&quot;>from the start of</label> <select id=&quot;range-start&quot; name=&quot;range-start&quot;> <option value=&quot;2006-01&quot;>January 2006</option> ... </select> </li> <li> <label for=&quot;range-end&quot;>until the end of</label> <select id=&quot;range-end&quot; name=&quot;range-end&quot;> <option value=&quot;2006-01&quot;>January 2006</option> ... </select> </li> </ol> </dd> </dl> </li> </ul> </fieldset> Itʼs a lot of code...
  • 72. COMPLEX FORM: RELATED FIELDS ...but the benefits are worth it Confine results to List of three items bullet Radio button (not checked) within the last year bullet Radio button (not checked) the month of Combo box January bullet Definition list of one item Radio button (not checked) a monthly range equals List of two items one: from the start of Combo box January 2006 two: until the end of Combo box January 2006 List end List end List end transcribed by Fangs
  • 73. COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> /* We'll save some space and inherit styles from .radio */ form ol, form ul, form dl { list-style: none; margin: 0; padding: 0; } li ul, li ol { font-size: 1em; }
  • 74. COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> .related li { clear: both; float: none; margin: 0 0 .5em; width: auto; } /* For IE to recover from a strange margin */ .related li { zoom: 1; }
  • 75. COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> .related select { margin-left: .25em; } .related dd { margin: .5em 0 0; padding: 0 0 0 3em; } .related dd label { float: left; line-height: 1.9; width: 100px; }
  • 76. COMPLEX FORM: RELATED FIELDS <fieldset class=&quot;radio related&quot;> <legend><span>Confine results to</span></legend> <ul> <li> <!-- year --> </li> <li> <!-- month --> </li> <li> <!-- range --> </li> </ul> </fieldset> .related legend span { display: block; line-height: 1.8; text-align: right; width: 120px; position: absolute; top: 0; left: -130px; }
  • 79. MESSAGING: REQUIRED What is the * anyway? Well, it stands for something else and in HTML, the closest to that we have to convey that is the ABBR element. <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p> Required fields are marked <abbr title = &quot;required&quot; > * </abbr> . </p> <ol> <li> <label for=&quot;contact-name&quot;> Name < abbr title = &quot;required&quot; > * </ abbr > </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /> </li> ...
  • 80. MESSAGING: REQUIRED If you want to go all-out, you can but that seems like overkill <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p> Required fields are marked <em><abbr title = &quot;required&quot; > * </abbr></em>. </p> <ol> <li class = &quot;required&quot; > <label for=&quot;contact-name&quot;> Name <em>< abbr title = &quot;required&quot; > * </ abbr ></em> </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /> </li> ...
  • 81. MESSAGING: REQUIRED <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> <ol> <li> <label for=&quot;contact-name&quot;> Name<abbr title=&quot;required&quot;>*</abbr> </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /> </li> ...
  • 82. MESSAGING: REQUIRED <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> <ol> <li> <label for=&quot;contact-name&quot;> Name<abbr title=&quot;required&quot;>*</abbr> </label> <input type=&quot;text&quot; id=&quot;contact-name&quot; name=&quot;name&quot; /> </li> ... abbr { cursor: help; font-style: normal; border: 0; }
  • 84. MESSAGING: FORMATTING How should we emphasize important formatting info? ... <li> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> <li> <label for = &quot;contact-phone&quot; > Phone <em class = &quot;msg&quot; > format: 123-456-7890 </em> </label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; /> </li> <li> <label for=&quot;contact-subject&quot;> Subject<abbr title=&quot;required&quot;>*</abbr> </label> <select id=&quot;contact-subject&quot; name=&quot;subject&quot;> <option value=&quot;Error&quot;>I noticed a website error</option> ...
  • 85. MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; /> </li> ...
  • 86. MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; /> </li> ... label em.msg { font-size: .8em; font-style: normal; line-height: 2.5; }
  • 87. MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; /> </li> ... label{ ... position: relative; } label em.msg { color: #aaa; font-size: .8em; font-style: normal; line-height: 2.5; position: absolute; right: -266px; top: 0; }
  • 88. MESSAGING: FORMATTING ... <li> <label for=&quot;contact-phone&quot;>Phone<em class=&quot;msg&quot;> format: 123-456-7890</em></label> <input type=&quot;text&quot; id=&quot;contact-phone&quot; name=&quot;phone&quot; /> </li> ...
  • 90. MESSAGING: ERRORS How should we strongly emphasize even more important error advisories? How should we highlight the field? ... <li class = &quot;error&quot; > <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr> < strong class = &quot;err&quot; > You forgot to fill in your email </ strong > </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ...
  • 91. MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ...
  • 92. MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ... strong.err { color: #ffdfdf; display: block; padding-left: 5px; text-align: left; }
  • 93. MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ... strong.err { color: #ffdfdf; display: block; line-height: 1.8; padding-left: 5px; text-align: left; white-space: nowrap; position: absolute; top: 0; left: 390px; } strong.err:before { content: &quot;<&quot; }
  • 94. MESSAGING: ERRORS ... <li class=&quot;error&quot;> <label for=&quot;contact-email&quot;> Email<abbr title=&quot;required&quot;>*</abbr><strong class=&quot;err&quot;> You forgot to fill in your email</strong> </label> <input type=&quot;text&quot; id=&quot;contact-email&quot; name=&quot;email&quot; /> </li> ... .error input { border: 2px solid #b00; background: #ffdfdf; } .error input:focus { background: #fff; }
  • 95. MESSAGING: ERRORS How do we notify users of errors? It is best to be upfront about errors encountered and to say, in plain language, what the user needs to do to fix it and linking to the field with errors doesn't hurt <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> < div id = &quot;errors&quot; > < p > We encountered < strong > 1 error </ strong > while trying to process this form: </ p > < ol > < li > You forgot to include < a href = &quot;#contact-email&quot; > your email address </ a ></ li > </ ol > </ div > <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ...
  • 96. MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ...
  • 97. MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ... #errors { background: #ffdfdf; border: 2px solid #b00; color: #333; margin: .5em 0 1em; padding: 10px; }
  • 98. MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ... #errors p { margin: 0; padding: 0; } #errors ol { list-style: disc; margin: 0 0 0 20px; }
  • 99. MESSAGING: ERRORS <form id=&quot;contact-form&quot; action=&quot;test.php&quot; method=&quot;get&quot;> <fieldset> <legend>Send us a message</legend> <div id=&quot;errors&quot;> <p>We encountered <strong>1 error</strong> while trying to process this form:</p> <ol> <li>You forgot to include <a href=&quot;#contact-email&quot;>your email address</a></li> </ol> </div> <p>Required fields are marked <abbr title=&quot;required&quot;>*</abbr>.</p> ... #errors a { color: #b00; }
  • 100. PARTING ADVICE • treat forms like any other piece of (X)HTML • be aware of browser inconsistencies & make accommodations (when possible) • break a complex form into bite-size chunks • look for ways to provide richer meaning/a better experience • apply your CSS layout knowledge for the rest of the page to a form • don't over-complicate form design • learn to love forms
  • 101. FORMS ARE NOT NECESSARILY EVIL