<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:series="http://unfoldingneurons.com/"
><channel><title>Larry Ullman &#187; html forms</title> <atom:link href="http://www.larryullman.com/tag/html-forms/feed/" rel="self" type="application/rss+xml" /><link>http://www.larryullman.com</link> <description>Translating Geek Into English</description> <lastBuildDate>Mon, 21 May 2012 11:03:07 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>The $300 Million Button</title><link>http://www.larryullman.com/2009/05/26/the-300-million-button/</link> <comments>http://www.larryullman.com/2009/05/26/the-300-million-button/#comments</comments> <pubDate>Tue, 26 May 2009 12:50:33 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[html forms]]></category> <category><![CDATA[ui]]></category> <category><![CDATA[user interface]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=424</guid> <description><![CDATA[If you haven&#8217;t yet read it, this article called The $300 Million Button is well worth your five minutes. It&#8217;s by Jared M. Spool and posted on the User Interface Engineering Web site. I don&#8217;t want to give away the secret of the article, but it discusses a very common practice on e-commerce sites, and [...]]]></description> <content:encoded><![CDATA[<p>If you haven&#8217;t yet read it, this article called <a
href="http://www.uie.com/articles/three_hund_million_button/">The $300 Million Button</a> is well worth your five minutes. It&#8217;s by <a
href="http://www.uie.com/brainsparks/author/jared/">Jared M. Spool</a> and posted on the <a
href="http://www.uie.com/">User Interface Engineering</a> Web site. I don&#8217;t want to give away the secret of the article, but it discusses a very common practice on e-commerce sites, and how it tests with end users.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/05/26/the-300-million-button/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Better HTML Forms</title><link>http://www.larryullman.com/2008/12/14/better-html-forms/</link> <comments>http://www.larryullman.com/2008/12/14/better-html-forms/#comments</comments> <pubDate>Sun, 14 Dec 2008 22:27:01 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[html forms]]></category> <category><![CDATA[ui]]></category> <category><![CDATA[user interface]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=47</guid> <description><![CDATA[One of the sessions I attended at the 2008 Adobe MAX conference in San Francisco was Creating Attractive, Usable, and Accessible Forms, presented by Rob Huddleston. I went to this session as part of my current drive to improve my user interface (UI) and Web accessibility skills. In this post I&#8217;ve collected a few do&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>One of the sessions I attended at the 2008 Adobe MAX conference in San Francisco was <em>Creating Attractive, Usable, and Accessible Forms</em>, presented by <a
href="http://www.robhuddleston.com">Rob Huddleston</a>. I went to this session as part of my current drive to improve my <a
href="http://www.larryullman.com/tag/user-interface/">user interface (UI)</a> and Web accessibility skills. In this post I&#8217;ve collected a few do&#8217;s and dont&#8217;s that I jotted down during Huddleston&#8217;s presentation. As was the case for me, you&#8217;ll likely already know some of these, some might serve as reminders of something you already knew, and hopefully a couple will make you think about rewriting some of your HTML forms today.<span
id="more-47"></span> <a
href="http://www.larryullman.com/examples/better_html_forms.html" target="_blank">Click here to view an example of some of these ideas.</a></p><p><strong>An HTML form should&#8230;</strong></p><ul><li>Provide good instructions. Indicate to the user what they should do, what will happen next, etc.</li><li>Clearly indicate which fields are required. Use of asterisks, bold font, or a different font color is the standard. Also have a note that indicates that these formatting changes mean the fields are required.</li><li>Explain why specific data is being requested. This is particularly important, as you want to make the user comfortable when providing their personal information. If you&#8217;re asking for anything sensitive or just somewhat unusual, make sure you include the reason why. It&#8217;s also a good idea to let the user know that their personal information&#8211;email address and phone number, in particular&#8211;won&#8217;t be used for malicious purposes.</li><li>Use client-side (i.e., JavaScript) form validation. You absolute must also use server-side validation (for security purposes) but using client-side validation gives the user immediate feedback, without having to send the page to the server.</li><li>Use the fieldset and legend tags to distinguish the form from the rest of the page. I really like these tags and also feel they are underused. Multiple fieldset and legend tags can be used to separate a longer form into its logical components. <a
href="http://www.larryullman.com/examples/better_html_forms.html" target="_blank">See the example for what these do to a form.</a></li><li>Place a submit button at the top and button of a long form. I&#8217;m not completely sold on this one but thought I&#8217;d mention it as <a
href="http://www.robhuddleston.com">Rob Huddleston</a> advocated it in his presentation. The argument for it is that user&#8217;s often go back up to a page or may like having it there if they have to correct a couple of quick things. The argument against it is that it may encourage the user to submit the form prematurely (i.e., before they&#8217;ve scrolled down and seen the rest of the form).</li><li>Use the label tag for all inputs. This is an accessibility issue, plus using a label brings up some nice features in the Web browers. For example, most browsers will bring focus to a form element if you click on its label. Labels can be written in a couple of ways, but here&#8217;s one recommendation:</li><p><code>&lt;label for="something"&gt; Something &lt;/label&gt; &lt;input type="text" id="something" name="something" /&gt;</code></ul><p><strong>An HTML form should not&#8230;</strong></p><ul><li>Request information you have no intention of using or needing. <a
href="http://www.robhuddleston.com">Rob Huddleston</a> pointed out, as a common example, that e-commerce sites don&#8217;t really need to ask the credit card type, as the number itself indicates the type.</li><li>Use tables. Tables are pretty outdated by now and should be used sparingly, if at all (CSS should be used instead). Besides the aesthetic and standards issues with tables, they break up forms poorly and can interfere with the use of label tags.</li><li>Contain reset buttons. This is one I learned ten years ago that&#8217;s really stuck with me. And yet, lots of forms still have reset buttons. The argument against reset buttons is that the user may inadvertently click it instead of submit, thereby destroying all of their efforts. And how often do users actually need to reset a form? Never? Almost never? More likely a user would either reload the page if they want to start from scratch (which I just don&#8217;t think they ever need to do) or go to another page if they decide not to submit the form. Really: best not to use reset buttons at all.</li></ul><p>Rob Huddleston also recommended the books <a
href="http://click.linksynergy.com/fs-bin/click?id=*Bm0DIfkEko&amp;offerid=145244.378526&amp;type=2&amp;subid=0">Don&#8217;t Make Me Think</a><img
src="http://ad.linksynergy.com/fs-bin/show?id=*Bm0DIfkEko&amp;bids=145244.378526&amp;type=2&amp;subid=0" border="0" alt="" width="1" height="1" /> by Steve Krug and <a
href="http://click.linksynergy.com/fs-bin/click?id=*Bm0DIfkEko&amp;offerid=145244.448536&amp;type=2&amp;subid=0">Designing with Web Standards</a><img
src="http://ad.linksynergy.com/fs-bin/show?id=*Bm0DIfkEko&amp;bids=145244.448536&amp;type=2&amp;subid=0" border="0" alt="" width="1" height="1" /> by Jeffrey Zeldman. I haven&#8217;t read either yet myself, although both are on my wish lists. I think it&#8217;s safe to say that both are considered standard books on the subjects.</p><p>I&#8217;ll be posting more on HTML forms in this blog, and you may also want to check out my post on <a
href="http://www.larryullman.com/2008/12/09/are-you-down-with-poka-yoke/">poka-yoke</a>. When I get the chance, I&#8217;ll try to add some CSS suggestions for making forms look even nicer.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2008/12/14/better-html-forms/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Are you down with Poka-yoke?</title><link>http://www.larryullman.com/2008/12/09/are-you-down-with-poka-yoke/</link> <comments>http://www.larryullman.com/2008/12/09/are-you-down-with-poka-yoke/#comments</comments> <pubDate>Wed, 10 Dec 2008 02:27:12 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[error]]></category> <category><![CDATA[html forms]]></category> <category><![CDATA[ui]]></category> <category><![CDATA[user interface]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=37</guid> <description><![CDATA[One of the sessions I attended at the 2008 Adobe MAX conference in San Francisco was Web Application Development: The Error of Our Ways, presented by Robert Hoekman, Jr.. I went to this session in particular as part of my current drive to improve my user interface (UI) and Web accessibility skills. In the session, [...]]]></description> <content:encoded><![CDATA[<p>One of the sessions I attended at the 2008 Adobe MAX conference in San Francisco was <em>Web Application Development: The Error of Our Ways</em>, presented by <a
href="http://www.rhjr.net">Robert Hoekman, Jr.</a>. I went to this session in particular as part of my current drive to improve my <a
href="http://www.larryullman.com/2008/12/06/user-interface/">user interface (UI)</a> and Web accessibility skills. In the session, Hoekman mentioned the concept of <em>poka-yoke</em>, a Japanese term that means fool-proofing or mistake-proofing (<a
href="http://en.wikipedia.org/wiki/Poka-yoke">see the Wikipedia entry</a>).<span
id="more-37"></span></p><p>The thinking behind poka-yoke is that a thing&#8211;software, hardware, whatever&#8211;shapes the user&#8217;s behavior in order to prevent or limit mistakes. An example that Wikipedia gives is how the key in an automatic transmission car cannot be removed unless the car is in park: the car tries to prevent you from leaving it in an unsafe state.</p><p>As Hoekman said in his presentation, we <em>should</em> be designing Web sites and software using poka-yoke, but often the design and interface of our creations <em>encourages</em> users to make mistakes. Or practically forces them to. For example, if you want a date in a specific format, you could indicate the format required. But a better solution would be to use a pop-up calendar widget where the user selects a date, that then formats that date properly. Even better, program your system so it accepts a date in multiple different formats in case the user doesn&#8217;t use the calendar widget. This last notion is part of a general theory of providing alternatives to your users, not trying to lock them into using your site in one set way (again, this is coming from Hoekman).</p><p>For more information on this subject, you should check out Hoekman&#8217;s <a
href="http://www.rhjr.net">site</a> and his books. I&#8217;ve not read them myself, but have added them to my ever-growing list of books that I intend to read someday. His first is <a
href="http://click.linksynergy.com/fs-bin/click?id=*Bm0DIfkEko&#038;offerid=145244.463458&#038;type=2&#038;subid=0" >Designing the Obvious: A Common Sense Approach to Web Application Design</a><img
border=0 width=1 height=1 src="http://ad.linksynergy.com/fs-bin/show?id=*Bm0DIfkEko&#038;bids=145244.463458&#038;type=2&#038;subid=0" />. His most recent is <a
href="http://www.amazon.com/gp/product/0321535081?ie=UTF8&#038;tag=dmcinsiinc-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0321535081">Designing the Moment: Web Interface Design Concepts in Action</a><img
src="http://www.assoc-amazon.com/e/ir?t=dmcinsiinc-20&#038;l=as2&#038;o=1&#038;a=0321535081" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2008/12/09/are-you-down-with-poka-yoke/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Final Steps Before Taking a Site Live</title><link>http://www.larryullman.com/2008/12/07/final-steps-before-taking-a-site-live/</link> <comments>http://www.larryullman.com/2008/12/07/final-steps-before-taking-a-site-live/#comments</comments> <pubDate>Mon, 08 Dec 2008 03:31:51 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[html forms]]></category> <category><![CDATA[ui]]></category> <category><![CDATA[user interface]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=25</guid> <description><![CDATA[A reader named Max posted a suggestion in my book forums that I include a checklist of final steps to take before a Web site goes live (read his post). I don&#8217;t know if it&#8217;ll make it into a book but it&#8217;s a good idea so I thought I&#8217;d give it its due here. In [...]]]></description> <content:encoded><![CDATA[<p>A reader named Max posted a suggestion in my book forums that I include a checklist of final steps to take before a Web site goes live (<a
href="http://www.larryullman.com/forum/read.php?19,39999">read his post</a>). I don&#8217;t know if it&#8217;ll make it into a book but it&#8217;s a good idea so I thought I&#8217;d give it its due here. In this first post I&#8217;ll discuss general steps to take, regardless of the technologies being used. In a separate post, I&#8217;ll discuss PHP and MySQL specific steps; later, I&#8217;ll post for a Ruby on a Rails site.</p><p>Once you&#8217;ve finalized all the functionality and appearance of a site (or thought you have, at least), you should&#8230;<span
id="more-25"></span><strong>Confirm that all links work.</strong> You can use automated software that will spider through your site and report any dead links. Using one of these applications, and there are free ones available, is really simple and definitely worth your minimal effort.</p><p><strong>Validate all HTML.</strong> Use an online HTML validation system to confirm that there are no syntactical problems on any page. This should include pages that are the result of form submissions, with and without errors, etc. Any page that a user may see in any state should be validated!</p><p><strong>Test! Test! Test!</strong> You&#8217;ve already tested your site, right? Lots of times? Have your spouse or significant other or parent or roommate or whomever test it. Have someone less technically skilled than you test it. Retest it yourself, this time with the approach of &#8220;What happens if I do this?&#8221;, even if what you attempt is something you&#8217;d never think anyone would ever try.</p><p><strong>Test in multiple browsers on multiple platforms.</strong> You don&#8217;t have to take all of these steps using multiple browsers on multiple platforms, but you should at least hit some of the key pages so you know that everything looks right. Also keep in mind that IE 6 behaves differently than IE 7 or Firefox 2 vs. Firefox 3. Just testing in the latest version of one browser is not sufficient. To simplify things, consider using a site like <a
href="http://browsershots.org/">BrowserShots.org</a>.</p><p><strong>Try to hack your site.</strong> Make sure you&#8217;ve applied good security measures by doing very, very bad things and making sure nothing horrendous happens.</p><p><strong>Have a good &#8220;Page Not Found&#8221; page.</strong> Although it&#8217;s best not to have dead links on your site, a truly professional site has a nice &#8220;Page Not Found&#8221; page that handles any missing pages. It should look like the rest of your site, provide a helpful message as to what happened (i.e., why they&#8217;re seeing that page), and provide navigation to the site&#8217;s actual pages.</p><p>Well, that&#8217;s the list I have at the top of my head. I&#8217;m sure you have other suggestions and I&#8217;d love to hear them!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2008/12/07/final-steps-before-taking-a-site-live/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Checking for Form Submissions in PHP</title><link>http://www.larryullman.com/2008/11/09/checking-for-form-submissions-in-php/</link> <comments>http://www.larryullman.com/2008/11/09/checking-for-form-submissions-in-php/#comments</comments> <pubDate>Mon, 10 Nov 2008 01:53:52 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[html forms]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=6</guid> <description><![CDATA[One important topic in PHP is how to know when to handle a form&#8217;s submission. If you have two pages&#8211;page.html and handle_page.php&#8211;the assumption is that whenever handle_page.php is accessed, it&#8217;s handling a form. This may not always be true, but is a reasonable enough assumption. However, more commonly the same page is used to both [...]]]></description> <content:encoded><![CDATA[<p>One important topic in PHP is how to know when to handle a form&#8217;s submission. If you have two pages&#8211;page.html and handle_page.php&#8211;the assumption is that whenever handle_page.php is accessed, it&#8217;s handling a form. This may not always be true, but is a reasonable enough assumption. However, more commonly the same page is used to both display and handle an HTML form. In such situations, that page is being accessed twice: once when the form is loaded and a second time when the form is submitted back to this same form. The trick is being able to identify which stage the page is in.<span
id="more-6"></span></p><p>An old way to do this is to just check for the presence of the submit variable. Say you define your form&#8217;s submit button like so:</p><pre>&lt;input type="submit" name="submit" value="Go!" /&gt;</pre><p>When the form is submitted, then $_POST['submit'] will be set (assuming you use the POST method, of course). Unfortunately this approach will not work in two situations:</p><ol><li>If the user submits the form by pressing Enter/Return in Internet Explorer, the $_POST['submit'] will not be set.</li><li>If you want to use an image for the submit button.</li></ol><p>For that matter, you can&#8217;t accurately check for the presence of any other form element because the user may not properly fill out the form (something that your PHP script would need to validate).</p><p>One reliable solution, which I have been using in my code and books, is to create a hidden input, with any name and any value:</p><pre>&lt;input type="hidden" name="submitted" value="1" /&gt;</pre><p>Then, when the form is submitted, $_POST['submitted'] will be set (assuming, again, that you used the POST method). Worst case scenario, if the user manipulated the form so that it didn&#8217;t contain this element, then submitted the form, that form wouldn&#8217;t be processed (which it&#8217;s best that it isn&#8217;t anyway).</p><p>Another option, which I&#8217;ll likely start using in my books (I&#8217;ll have to confirm that there&#8217;s no downside), is to check how the page was requested. As you probably know, there are two common methods for requesting a page: GET and POST. These are also the values used for the action attribute of a form. Most pages loaded in the Web browser&#8211;by typing in an address or clicking a link&#8211;are requested using GET. So the first time a page that both displays and handles a form is accessed (i.e., when the form is displayed), it&#8217;s a GET request. When that form is submitted, it&#8217;s a POST request (assuming the POST method is used, right? Right). So to check which state the page is in, refer to $_SERVER['REQUEST_METHOD']:</p><pre>&lt;?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle the form... ?&gt;</pre><p>As I said, this sounds like a good solution to me but I still want to do a little research to confirm that it&#8217;s reliable (e.g., that all Web servers on all OSes populate this variable).</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2008/11/09/checking-for-form-submissions-in-php/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-05-21 14:57:54 by W3 Total Cache -->
