<?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/"
	>

<channel>
	<title>Yelotofu &#187; Accessibility</title>
	<atom:link href="http://www.yelotofu.com/topics/accessibility/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yelotofu.com</link>
	<description>&#34;In building standards compliant sites we are creating a better Web for the future.&#34;</description>
	<lastBuildDate>Sat, 11 May 2013 06:28:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>jQuery Numeric Stepper</title>
		<link>http://www.yelotofu.com/2008/07/jquery-numeric-stepper/</link>
		<comments>http://www.yelotofu.com/2008/07/jquery-numeric-stepper/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 19:19:01 +0000</pubDate>
		<dc:creator>caphun</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[numericstepper]]></category>
		<category><![CDATA[spinner]]></category>
		<category><![CDATA[stepper]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://yelotofu.com/?p=93</guid>
		<description><![CDATA[As an experiement I ported over my Accessible Numeric Stepper into a jQuery widget and added some accessibility enhancements and new features in the process. This widget utilises ui.core.js &#8211; a factory method object for creating widget classes. Widgets in jQuery are essentially plugins at heart but built to follow stricter coding standards in order [...]]]></description>
				<content:encoded><![CDATA[<p>As an experiement I ported over my <a href="http://yelotofu.com/2007/07/building-an-unobtrusive-accessible-and-standards-compliant-numeric-stepper/">Accessible Numeric Stepper</a> into a jQuery widget and added some accessibility enhancements and new features in the process.</p>
<p>This widget utilises <a href="http://docs.jquery.com/UI/Developer_Guide">ui.core.js</a> &#8211; a factory method object for creating widget classes. Widgets in jQuery are essentially plugins at heart but built to follow stricter coding standards in order to unify the underlying quality between developers. It also adds convenient mouse interaction classes and option settings among other things.</p>
<p>The result is <a href="http://yelotofu.com/labs/jquery/UI/stepper/">jQuery Numeric Stepper</a> an unofficial jQuery UI widget. Features include:</p>
<ul>
<li>min, max, start and step size settings</li>
<li>supports decimal values and decimal step sizes</li>
<li>supports currency values</li>
<li>keyboard and mousewheel interaction &#8211; increment/decrement values via cursor keys, <kbd>+</kbd>/<kbd>-</kbd> keys and mousewheel</li>
</ul>
<p><a href="http://yelotofu.com/labs/jquery/UI/stepper/jquery.ui.stepper-latest.zip">Download latest source code here</a></p>
<p>Bugs? Missing feature? Code improvements? Let me know!</p>
<p><strong>Update:</strong> Features seen here are now part of the official jQuery UI Spinner, set for the 1.6 release of jQuery UI. <a href="http://yelotofu.com/2008/08/jquery-ui-spinner/">More details</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yelotofu.com/2008/07/jquery-numeric-stepper/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Web Accessibility Evaluation Tools</title>
		<link>http://www.yelotofu.com/2008/04/web-accessibility-evaluation-tools/</link>
		<comments>http://www.yelotofu.com/2008/04/web-accessibility-evaluation-tools/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 07:39:10 +0000</pubDate>
		<dc:creator>caphun</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[firefoxaccessibilityextension]]></category>
		<category><![CDATA[toolbar]]></category>
		<category><![CDATA[wave40]]></category>
		<category><![CDATA[wavetoolbar]]></category>
		<category><![CDATA[webaim]]></category>

		<guid isPermaLink="false">http://yelotofu.com/?p=79</guid>
		<description><![CDATA[WebAIM recently released the WAVE Toolbar for Firefox, which augments their free online accessbility evaluation service, known as WAVE. WAVE is currently in version 4, much like Cynthia Says but with a focus on developer friendliness by overlaying results visually above the page you are testing. I think WAVE is a pretty cool idea. The [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webaim.org/">WebAIM</a> recently released the <a href="http://wave.webaim.org/toolbar">WAVE Toolbar</a> for Firefox, which augments their free online accessbility evaluation service, known as <a href="http://wave.webaim.org/">WAVE</a>. WAVE is currently in version 4, much like <a href="http://www.contentquality.com/">Cynthia Says</a> but with a focus on developer friendliness by overlaying results visually above the page you are testing. I think WAVE is a pretty cool idea. The fact of the matter that no automated tool can ever tell whether a website is truly accessible means it always boils down to human assessment in the end. So a visual tool is much welcomed as the explanations you get from Cynthia are quite cryptic at times.</p>
<p>For more power in your toolbar I recommend trying out the <a href="http://firefox.cita.uiuc.edu/">Firefox Accessibility Extension.</a> This one is primarily an assistive tool for people with disabilities browsing the Web but also doubles up as a great accessibility evaluation tool for developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yelotofu.com/2008/04/web-accessibility-evaluation-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unobtrusive, Accessible and Standards Compliant Numeric Stepper (revisited)</title>
		<link>http://www.yelotofu.com/2008/01/unobtrusive-accessible-standards-compliant-numeric-stepper-revisited/</link>
		<comments>http://www.yelotofu.com/2008/01/unobtrusive-accessible-standards-compliant-numeric-stepper-revisited/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 21:22:49 +0000</pubDate>
		<dc:creator>caphun</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[accessible]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[dojotoolkit]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[numericspinner]]></category>
		<category><![CDATA[numericstepper]]></category>
		<category><![CDATA[unobtrusive]]></category>
		<category><![CDATA[webstandards]]></category>

		<guid isPermaLink="false">http://yelotofu.com/2008/01/unobtrusive-accessible-standards-compliant-numeric-stepper-revisited/</guid>
		<description><![CDATA[July last year I wrote a small tutorial on how to build an Unobrustive, Accessible and Standards Compliant Numeric Stepper. As of today it remains the most high traffic page on my site. I can see there is interest out there in a HTML and JavaScript based Numeric Stepper since the most searched for terms [...]]]></description>
				<content:encoded><![CDATA[<p>July last year I wrote a small tutorial on how to build an <a href="http://yelotofu.com/2007/07/building-an-unobtrusive-accessible-and-standards-compliant-numeric-stepper/">Unobrustive, Accessible and Standards Compliant Numeric Stepper</a>. As of today it remains the most high traffic page on my site. I can see there <em>is</em> interest out there in a HTML and JavaScript based Numeric Stepper since the most searched for terms are:</p>
<ol>
<li>javascript numeric stepper</li>
<li>html numeric stepper</li>
<li>numericstepper javascript</li>
</ol>
<p>So with some downtime on my hands I did some code refactoring and added a few Accessibility improvements: Now, when the Textbox has focus pressing the up or down arrow cursor keys will increment or decrement the numeric value respectively. Also with the cursor keys you can now navigate between the Textbox and plus and minus buttons without resorting to the Mouse pointer.</p>
<p><a href="http://yelotofu.com/labs/numeric-stepper/version/0.1.2/ns-example.html">Test the new cursor key feature with this example</a></p>
<p>As an aside, <a href="http://dojotoolkit.org">the Dojo Toolkit</a> has a Numeric Stepper as part of <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit-0">Dijit, the Dojo Widgit Library</a>. They call it a <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/form-validation-specialized-input/number-spinner">NumericSpinner</a>. It&#8217;s pretty powerful though looks bad with CSS switched off. Additionally, the Dojo Toolkit tends to add proprietary attributes to your HTML, hence breaking validation.</p>
<p><a href="http://yelotofu.com/labs/numeric-stepper/version/0.1.2/ns-0.1.2.zip">Get latest version (NumericStepper v0.1.2)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yelotofu.com/2008/01/unobtrusive-accessible-standards-compliant-numeric-stepper-revisited/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>7 Ways To Write &#8220;Better&#8221; HTML</title>
		<link>http://www.yelotofu.com/2007/12/seven-ways-to-write-better-html/</link>
		<comments>http://www.yelotofu.com/2007/12/seven-ways-to-write-better-html/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 09:26:42 +0000</pubDate>
		<dc:creator>caphun</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[barcamphongkong2007]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[webstandards]]></category>

		<guid isPermaLink="false">http://yelotofu.com/2007/12/7-ways-to-better-html/</guid>
		<description><![CDATA[BarCamp came and went, I&#8217;m still experiencing the aftermath; making new connections on Facebook daily and checking the BarCamp Hong Kong 2007 Flickr Group constantly for new photos! Anyway, It&#8217;s about time I catalogued my talk before it&#8217;s too late! The original presentation slide show was created with S5 (a standards compliant and accessible slide [...]]]></description>
				<content:encoded><![CDATA[<p>BarCamp came and went, I&#8217;m still experiencing the aftermath; making new connections on <a href="http://www.facebook.com">Facebook</a> daily and checking the <a href="http://www.flickr.com/groups/barcamphongkong2007/">BarCamp Hong Kong 2007 Flickr Group</a> constantly for new photos! Anyway, It&#8217;s about time I catalogued my talk before it&#8217;s too late! <a href="http://yelotofu.com/presentations/barcamphk2007/">The original presentation slide show</a> was created with <a href="http://meyerweb.com/eric/tools/s5/">S5</a> (a standards compliant and accessible slide show system). Feel free to run that side-by-side whilst reading this article as it&#8217;s segmented to match the presentation. <strong>Warning:</strong> This post is pretty long! I hope I don&#8217;t bore you.</p>
<h2>Introduction</h2>
<p>HTML is an age old topic which I&#8217;m sure you&#8217;re already very familiar with and has been talked about zillions of times. However, I think there is room for such a topic given the apparent lack of knowledge of Web Standards among the general web populous in Hong Kong. Hopefully by the end of this post I will of at least spark some interest in writing better, and by better I mean, semantically rich and standards compliant HTML.</p>
<h2>1. Use a DOCTYPE declaration</h2>
<p>If you&#8217;re using a HTML editor to create HTML then chances are a DOCTYPE is added to your pages automatically, so generally we tend to not take much notice of it. There are several DOCTYPE flavours however. A Strict DTD is used when you want clean markup free from presentational elements. A Transitional DTD when you want to add some presentational features to your HTML. There is also a Frameset DTD used for laying out pages with framesets, however you should never need this one; you shouldn&#8217;t be using frames!</p>
<p>It&#8217;s always good practice to add a DOCTYPE to the top of each and every HTML page because it enables what we call DOCTYPE switching. There are essentially two basic modes “quirks mode” and “standards mode”. In quirks mode the browser will behave like old browsers of the late 90&#8242;s and standards mode will follow the W3C recommendations. A browser will work in quirks mode if there is no DOCTYPE to be found. Internet Explorer will even switch to quirks mode if the first line of your HTML has no DOCTYPE, a blank line counts too! The most famous effect of switching to “standards mode” is the change in <a href="http://www.communitymx.com/content/article.cfm?cid=E0989953B6F20B41">the Box model and problems with the old IE model</a>. There is also a third &#8220;almost-standards mode&#8221; which is available in Mozilla and Firefox browsers. The almost-standards mode is activated by a transitional DTD and doesn&#8217;t follow the W3C cell height specification. So next time you create a new HTML file give yourself a second to think about the DOCTYPE you&#8217;re using.</p>
<p>OK, which DOCTYPE should you use? It depends on the situation. <a href="http://www.zeldman.com/">Jeffrey Zelman</a> wrote a great article to help <a href="http://www.alistapart.com/articles/doctype/">Fix Your Site With the Right DOCTYPE</a> and <a href="http://hsivonen.iki.fi/author/">Henri Sivonen</a> wrote in detail about <a href="http://hsivonen.iki.fi/doctype/">Activating the right layout mode using the DOCTYPE</a>. Generally, if you&#8217;re starting out on a new project with a blank canvas I&#8217;d recommend using a strict DTD which helps to facilitate adherence to standards, obviously make the effort to <a href="http://validator.w3.org">validate</a> as well to <strong>ensure</strong> compliance!</p>
<h2>2. Don&#8217;t Abuse the Good!</h2>
<p>HTML is very simple to learn. In fact it&#8217;s so easy anyone could pretty much pick it up, as well as be proficient, in about 3 days. For that reason it&#8217;s a “language” that&#8217;s prone to exploitation as most learn from bad examples. There are only a handful of tags and only 30 are frequently used. The most exploited of them all are the <code>table</code> and <code>blockquote</code> elements.</p>
<p>The biggest step to writing better markup is to <a href="http://www.stopdesign.com/articles/throwing_tables/">throw away your tables</a>, but not all of them, only those being used for layout purposes. Think of tables as “data tables” and you&#8217;re on the right track. This is something that could prove difficult for those used to creating tables for layout. I myself started building websites in the era of table dominance and found it difficult to switch at first. I know how difficult it could be to unlearn bad habits, but believe me you will benefit immensely and it will open many doors. I would never go back to tables for layout now that I&#8217;ve mastered CSS layouts. Still not convinced? Pop open a new browser and read this interestingly animated article by Merikallio &amp; Pratt on <a href="http://www.hotdesign.com/seybold/">Why tables for layout is stupid</a>.<code></code></p>
<p>By definition a <code>blockquote</code> is <em>a BLOCK of QUOTEs</em>, hence a <code>blockquote</code> should always start with a <code>p</code>, but <code>blockquote</code> elements are often mis-used as indenter&#8217;s. Example of the write way to use a <code>blockquote</code>:<br />
[sourcecode language="html"]<br />
&lt;p&gt;&lt;cite&gt;Eric Meyer&lt;/cite&gt; wrote:&lt;/p&gt;<br />
&lt;blockquote cite=&quot;http://meyerweb.com/eric/thoughts/2005/03/11/social-protocols/&quot;&gt;<br />
&lt;p&gt;What&#8217;s so interesting to me is that the guys who<br />
decided tofocus on the positive went out and did something;<br />
those who want to mix in the negative seem to have<br />
nothing to offer except complaints.&lt;/p&gt;<br />
&lt;/blockquote&gt;<br />
&lt;p&gt;An excellent contrast between those who want to<br />
build new things and those who want to tear them down.&lt;/p&gt;<br />
[/sourcecode]<br />
Example taken from <cite><a href="http://tantek.com/presentations/2005/09/elements-of-xhtml/">The Elements of Meaningful XHTML</a></cite> by <cite><a href="http://www.tantek.com/">Tantek Çelik</a></cite></p>
<h2>3. Use the Right Tag for the Right Job</h2>
<p>Like a carpenter won&#8217;t use his screwdriver to hammer a nail into a piece of wood so the <code>p</code> element should not be used to break a line! However WYSIWYG editors tend to exploit the <code>p</code> element by using it as a line-break rather than a wrapper for a paragraph of text. Don&#8217;t do this in your hand crafted master piece!</p>
<p>There are 6 heading levels (<code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>) – <code>h1</code> being most important, and <code>h6</code> least important. Headings are used to section a page into logical chunks.</p>
<p>The <code>em</code> element is used to give a word or sentence emphasis, it does not mean italic text even though that&#8217;s what it looks like in a browser. Again WYSIWYG editors often exploit this fact, by producing an <code>em</code> element when users click on the  <em>I</em> icon.</p>
<p>The <code>strong</code> element is also in a similar situation being mistaken as <em>bold text</em>. The <code>strong</code> element should only be used when a stronger emphasis than the <code>em</code> element is needed. And <code>em</code>&#8216;s can be nested to give further emphasis.</p>
<p>Lastly there is <code>ul</code>, <code>ol</code>, and <code>dl</code>. Only use the <code>ol</code> when you have a list of items in which changing the order of an item will change the meaning of that list. A <code>ul</code> is for general lists and <code>dl</code> elements could be used for definitions or key-value pairs.</p>
<h2>4. Avoid Bed and BReakfast markup</h2>
<p><a href="http://tantek.com/log/2002/10.html#L20021022t1432">&lt;b&gt;ed and &lt;br&gt;eakfast markup</a> is a term coined by <a href="http://www.tantek.com/">Tantek Çelik</a> to describe the way people mis-use <code>b</code> and <code>br</code> elements for headings and paragraphs respectively. B &amp; BR is bad practice because it adds presentational markup and takes away what could have been an opportunity for more semantic meaning in a piece of text. <a href="http://yelotofu.com/presentations/barcamphk2007/">See presentation slide 18-20 for example.</a></p>
<h2>5. Headings are important</h2>
<p>As previously mentioned there are six heading levels. Where you start the first <code>h1</code> element is crucial to the overall structure and accessibility of a page. It&#8217;s usually best to have one <code>h1</code> only and that&#8217;s usually the site name. However, if you have a page of article listings (like a blog home page) then you might decide that the title of each article is far more important than the site name, hence it&#8217;s also possible to use <code>h1</code> elements as the title of each article. In which case you will end up with multiple <code>h1</code> elements. It&#8217;s also important not to skip levels in the page structure as it will mess up page quality. Sectioning a page into meaningful headings will also aid some screen readers and browsers to quickly navigate the page content by jumping from heading to heading. Finally headings are good for SEO, Accessibility and much better than <code>div</code> or <code>span</code> elements. A word of advice is to use headings where ever it makes sense and keep meaningless markup to a minimum.</p>
<h3>6. Don&#8217;t forget ALT text!</h3>
<p><em>Bad:</em> <code>&lt;img src=”car_photo.jpg”&gt;</code><br />
<strong>Acceptable:</strong> <code>&lt;img src=”car_photo.jpg” alt=””&gt;</code><br />
<em><strong>Good:</strong></em> <code>&lt;img src=”car_photo.jpg” alt=”my dream car”&gt;</code></p>
<p>It is a basic requirement of the WAI Level 1 guidelines that all <code>img</code> elements should have an accompanying ALT text. Now there may not seem any point there but what if your image is a link to another section of the site? An image link for example:</p>
<p><strong>Bad example:</strong><br />
[sourcecode language="html"]<br />
&lt;a href=&quot;portfolio.html&quot;&gt;&lt;img src=&quot;screenshot.jpg&quot; /&gt;&lt;/a&gt;<br />
[/sourcecode]<br />
Users who navigate your site with images turned off or use screen readers will not be able to make sense of the above. Worse still are images used as the main navigation without an ALT text for people to follow. An ALT text should be descriptive and give the user an idea of the context of the image. Sometimes it means explaining visual aspects; sometimes it&#8217;s a case of spelling out embedded copy. Make an effort to remove any decorative images from HTML and place inside CSS. If a decorative image cannot be avoided then either use blank ALT text or better still, let the user know it&#8217;s a decorative image and place it at the very bottom of your HTML source output.</p>
<h2>7. Use CSS for presentation</h2>
<p>It&#8217;s hard not to talk about CSS when talking about HTML. CSS complements HTML so well. I will only go briefly into CSS here but I&#8217;d recommend research into this topic if you&#8217;re really interested in writing “better” HTML. A good book to grab hold of is <a href="http://www.cssmastery.com/">CSS Mastery</a> by Andy Budd. Another good way to learn more about CSS is to view the CSS source of other people, see how they are doing things, learn from the experts! <a href="http://code.google.com/p/blueprintcss/">Blueprint</a> and <a href="http://developer.yahoo.com/yui/">YUI</a> have built CSS frameworks and is a good starting point for improving your own CSS skills. I don&#8217;t recommend using a framework per se but use it as a learning tool! Blueprint&#8217;s typography CSS is especially good. Investigate, learn and integrate.</p>
<p>Though CSS is used for presentation class names should not be based on presentational cues. Use <a href="http://microformats.org/wiki/semantic-class-names">semantic-class-names</a> at all times. Example:</p>
<p>BAD: redtext, boldtext, smallIcon and leftnav.<br />
GOOD: note, important, attachments and subnav</p>
<h2>+7 Ways It Will Benefit Your Online Business</h2>
<p>OK, so all this talk about writing &#8220;better&#8221; HTML seems like a waste of time. Why concentrate on this when you could work on more important aspects of your site? Such as a better design, cool Ajax features, and marketing! Well HTML <strong>is</strong> important and is one of the most important ones to get right! Here are 7 reasons why writing better HTML will benefit your business. <em>(It&#8217;s not just for the sake of ego and beauty or keeping your geeks busy!)</em></p>
<ul>
<li>
<h3>Your pages will load faster</h3>
<p>Because you removed much of the clutter of TABLE and spacer GIFs your pages will load faster.</li>
<li>
<h3>Lower your hosting costs</h3>
<p>Due to the reduced mark-up the total weight of your web page will be lower hence lowering payload, bandwidth and ultimately hosting and data transfer costs</li>
<li>
<h3>Lower the cost of a redesign</h3>
<p>Your website no longer contains presentational mark-up hence it&#8217;s more receptive to change. A change of design mostly consists of graphic and CSS modifications. The underlying HTML structure doesn&#8217;t have to change much and in some cases it doesn&#8217;t have to change at all!</li>
<li>
<h3>Maintain visual consistency</h3>
<p>Again, all presentational aspects have been moved to CSS so the write once use everywhere approach is used. In that CSS templates are created and applied across the board, hence it&#8217;s much easier to keep branding and design consistency.</li>
<li>
<h3>Get better search engine results</h3>
<p>Reduced clutter means your content can dominate the page and moved higher to the top of the HTML source output. Hence it is more favourable with search engines. Plus, by providing a document outline via headings you are giving a page more keyword relevance. Therefore, cleverly thought out headings that include relevant keywords will improve search engine rankings.</li>
<li>
<h3>More accessible to all viewers</h3>
<p>As we&#8217;ve now removed all clutter and provided section headings, alt text, and link titles pages become more accessible instantaneously. Not only to humans but to search engines alike. Remember, Google is blind! Google does not understand JavaScript (yet), it relies on headings to determine relevance, it reads the alt text to understand image content and it follows links of interest.</li>
<li>
<h3>It&#8217;s a winner!</h3>
<p>The Web Standards war has been won. So it&#8217;s here to stay whether you like it or not and will only grow in force as time goes by. If you don&#8217;t take note of it now your business will lose out in the long run and you <em>will</em> be playing catch-up. So get on the Web Standards bandwagon now! And write <em>better</em> HTML!</li>
</ul>
<p>Further reading:</p>
<ul>
<li><cite><a href="http://www.xml.com/pub/a/w3j/s1.people.html">The Web is Ruined and I Ruined It</a></cite> — <cite><a href="http://www.xml.com/pub/au/41">David Siegel</a></cite></li>
<li><cite><a href="http://www.alistapart.com/articles/frameworksfordesigners/">Frameworks for Designers</a></cite> — <cite><a href="http://www.alistapart.com/authors/c/jeffcroft">Jeff Croft</a></cite></li>
<li><a href="http://htmlmastery.com/">HTML Mastery</a> by Paul Haine</li>
<li><a href="http://www.cssmastery.com/">CSS Mastery</a> by Andy Budd</li>
<li><a href="http://www.transcendingcss.com/">Transcending CSS</a> by Andy Clarke</li>
<li><a href="http://www.zeldman.com/dwws/">Designing with standards, second edition</a> by Jeffery Zeldman</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.yelotofu.com/2007/12/seven-ways-to-write-better-html/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Building an Unobtrusive, Accessible and Standards Compliant Numeric Stepper</title>
		<link>http://www.yelotofu.com/2007/07/building-an-unobtrusive-accessible-and-standards-compliant-numeric-stepper/</link>
		<comments>http://www.yelotofu.com/2007/07/building-an-unobtrusive-accessible-and-standards-compliant-numeric-stepper/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 17:05:15 +0000</pubDate>
		<dc:creator>caphun</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[formcontrol]]></category>
		<category><![CDATA[numericstepper]]></category>
		<category><![CDATA[unobtrusive]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://yelotofu.com/2007/07/building-an-unobtrusive-accessible-and-standards-compliant-numeric-stepper/</guid>
		<description><![CDATA[First off, if you&#8217;re looking for a quick solution feel free to skip directly to the download link at the end of this article. For those who are interested in the intricate details please read on&#8230; What is a Numeric Stepper? Well, the answer is simple. It&#8217;s a form control and looks like this&#8230; It [...]]]></description>
				<content:encoded><![CDATA[<p>First off, if you&#8217;re looking for a quick solution feel free to skip directly to the download link at the end of this article. For those who are interested in the intricate details please read on&#8230;</p>
<h3>What is a Numeric Stepper?</h3>
<p>Well, the answer is simple. It&#8217;s a form control and looks like this&#8230;</p>
<p><img src="http://yelotofu.com/demo/numeric_stepper/example_numeric_stepper.png" title="A Numeric Stepper" alt="A Numeric Stepper" height="22" hspace="10" vspace="10" width="46" /></p>
<p>It has an intuitive look that does not require much brain power to figure out how to use. The name itself suggests it&#8217;s restricted to numeric values. The plus and minus signs indicate an ability to step up or down. The steps must be of equal size maintaining consistency. The great thing about Numeric Steppers is users can either enter a value or use the plus and minus buttons to arrive at a target value.</p>
<p>Flash UI developers have long since enjoyed this form control. In fact, it wasn&#8217;t until Flash came out with their UI components before I even heard of a Numeric Stepper!</p>
<h3>What is it used for?</h3>
<p>Numeric Steppers are not always useful. They are designed to solve a specific UI problem. Scenarios where Numeric Steppers would be of use are:</p>
<ul>
<li>In shopping baskets; so users can quickly change quantities.</li>
<li>When choosing number of years experience in a skill or profession. Some forms may contain many such questions so Numeric Steppers will facilitate quick mouse action.</li>
<li>When choosing number of children or family members. There is no logical upper limit to this question so a drop down is out of the question. A simple input box will serve well but means the user will have to leave their mouse; find the correct keyboard key; then enter a value. With a Numeric Stepper they&#8217;d simply click the mouse button a few times in succession to obtain their target value.</li>
</ul>
<p>These are just but a handful of scenarios. I&#8217;m sure there are much more good usage examples out there.</p>
<h3>Pity they didn&#8217;t think of it earlier?</h3>
<p>There is no equivalent HTML form control for the Numeric Stepper. I guess when forms were conceived there was no urgent need for them or the concept just didn&#8217;t exist back then. The rise of Ajax and rich UI interfaces have boosted the industry&#8217;s appetite for greater interactivity in forms. The chances of a Numeric Stepper playing more useful roles in forms is much greater now.</p>
<p>With that thought in mind we start our journey on building our own&#8230;</p>
<h3>Building the Numeric Stepper</h3>
<p>With help from JavaScript and a few basic form controls we can easily create our very own Numeric Stepper. The ingredients are: a standard text input, two buttons, a container to wrap it all up; and JavaScript to handle the associated events.</p>
<h4>The HTML</h4>
<pre language="html">
&lt;span class=&quot;numeric-stepper&quot;&gt;
&lt;input name=&quot;ns_textbox&quot; size=&quot;2&quot; type=&quot;text&quot; /&gt;
  &lt;button type=&quot;submit&quot; name=&quot;ns_button_1&quot; value=&quot;1&quot; class=&quot;plus&quot;&gt;+&lt;/button&gt;
  &lt;button type=&quot;submit&quot; name=&quot;ns_button_2&quot; value=&quot;-1&quot; class=&quot;minus&quot;&gt;-&lt;/button&gt;
&lt;/span&gt;
</pre>
<p><a href="/demo/numeric_stepper/example_1.html">Example 1: The HTML structure</a></p>
<p>You may notice submit buttons are used rather than &#8220;button&#8221; buttons. This is so if JavaScript is not available the Numeric Stepper will degrade gracefully. Clicking on the buttons will cause a form submit hence allowing developers to take event handling to the backend. I won&#8217;t go into details of how to do the backend as it&#8217;s out of the scope of this article.</p>
<p>I must stress that form submit on button click is NOT what we are after for JavaScript enabled browsers. Using unobtrusive Javascript we want to increment/decrement the input box value by a step size on button click. We also want the JavaScript to restrict it to numerical values only; and apply an upper and lower limit. The code is too much to present here so I&#8217;m only going to show the important parts:</p>
<h4>The JavaScript</h4>
<pre language="javascript">
var NumericStepper = {
  register : function(name, minValue, maxValue, stepSize){
    ...
    textbox.onkeypress = function(e){
      if(window.event){
        keynum = e.keyCode;
      } else if(e.which){
        keynum = e.which;
      }
      keychar = String.fromCharCode(keynum);
      numcheck = /[0-9-]/;
      if (keynum==8)
        return true;
      else
        return numcheck.test(keychar);
    };
    ...
  }
  ...
  ,stepper:function(textbox, val){
    if (textbox == undefined)
      return false;
    if (val == undefined || isNaN(val))
      val = 1;
      if (textbox.value == undefined || textbox.value == '' || isNaN(textbox.value))
        textbox.value = 0;
      textbox.value = parseInt(textbox.value) + parseInt(val);
      if (parseInt(textbox.value) &lt; NumericStepper.minValue)
        textbox.value = NumericStepper.minValue;
      if (parseInt(textbox.value) &gt; NumericStepper. maxValue)
        textbox.value = NumericStepper.maxValue;
    }
  ...
}
</pre>
<p><a href="/demo/numeric_stepper/example_2.html">Example 2: Numeric Stepper; no clothes</a></p>
<p>Our Numeric Stepper is nearly complete. It doesn&#8217;t look much like one at the moment; but with a little help from CSS we can give our Numeric Stepper some clothes.</p>
<h4>The CSS</h4>
<pre language="css">
.numeric-stepper {
  width:3.425em;
  height:1.6em;
  display:block;
  position:relative;
  overflow:hidden;
  border:1px solid #555;
}

.numeric-stepper input {
  width:75%;
  height:100%;
  float:left;
  text-align:center;
  vertical-align:center;
  font-size:125%;
  border:none;
  background:none;
}

.numeric-stepper button {
  width:25%;
  height:50%;
  font-size:0.5em;
  padding:0;
  margin:0;
  z-index:100;
  text-align:center;
  position:absolute;
  right:0;
}
.numeric-stepper button.minus {
  bottom:0;
}
</pre>
<p><a href="/demo/numeric_stepper/index.html">The final product: Unobtrusive, Accessible and Standards compliant.</a></p>
<p>The idea of clothes/skins is fascinating for our Numeric Stepper as it allows us to change its look and feel with some CSS trickery. Take a look at this <a href="http://yelotofu.com/demo/numeric_stepper/another_skin/index.html">graphical example</a>.</p>
<h3>The Source Code</h3>
<p>You can get hold of version 0.1 of the Numeric Stepper source code by following this <a href="http://yelotofu.com/demo/numeric_stepper/ns_v001.zip">download link</a>.</p>
<p>I have tested it on FF2, Opera 8.5, IE5.5, IE6, IE7 and Safari. Works well but the buttons look a little weird in Safari though still usable.</p>
<p>Bugfixes, code enhancements, feature requests &amp; improvements are welcome. Please do let me know if you use this code though and if you find it at all useful!</p>
<p><strong>Update:</strong> <a href="http://yelotofu.com/2008/01/unobtrusive-accessible-standards-compliant-numeric-stepper-revisited/">version 0.1.2</a> adds some accessibility enhancements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yelotofu.com/2007/07/building-an-unobtrusive-accessible-and-standards-compliant-numeric-stepper/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Avoiding Extreme Accessibility</title>
		<link>http://www.yelotofu.com/2007/06/avoiding-extreme-accessibility/</link>
		<comments>http://www.yelotofu.com/2007/06/avoiding-extreme-accessibility/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 19:29:01 +0000</pubDate>
		<dc:creator>caphun</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[extreme]]></category>
		<category><![CDATA[mike cherim]]></category>

		<guid isPermaLink="false">http://yelotofu.com/2007/06/avoiding-extreme-accessibility/</guid>
		<description><![CDATA[Mike Cherim of Beast-blog.com has written a nice little article on Avoiding Extreme Accessibility. &#8220;Over-thinking, over-engineering, or going to extremes is rarely a good thing when acted upon. Moderation is the key. We&#8217;ve all fallen foul of over accessifying a website but with all good intensions, after all Accessibility is a good thing. Let&#8217;s turn [...]]]></description>
				<content:encoded><![CDATA[<p>Mike Cherim of <a href="http://green-beast.com">Beast-blog.com</a> has written a nice little article on <a href="http://green-beast.com/blog/?p=182">Avoiding Extreme Accessibility</a>.</p>
<blockquote><p>&#8220;Over-thinking, over-engineering, or going to extremes is rarely a good thing when acted upon. Moderation is the key.</p></blockquote>
<p>We&#8217;ve all fallen foul of over accessifying a website but with all good intensions, after all Accessibility is a good thing. Let&#8217;s turn these good intensions into good use by thinking of our users as real human beings rather than aliens from outer space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yelotofu.com/2007/06/avoiding-extreme-accessibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>