<?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>Garrick Cheung &#187; class</title>
	<atom:link href="http://www.garrickcheung.com/tag/class/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.garrickcheung.com</link>
	<description>Sharing what I know and learn about CSS, MooTools, Javascript, PHP and etc.</description>
	<lastBuildDate>Fri, 30 Sep 2011 05:16:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>MooTools.Floor Does Form Validation Right!</title>
		<link>http://www.garrickcheung.com/mootools/mootoolsfloor-does-form-validation-right/</link>
		<comments>http://www.garrickcheung.com/mootools/mootoolsfloor-does-form-validation-right/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 06:05:59 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[form validation]]></category>
		<category><![CDATA[MooTools.Floor]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=82</guid>
		<description><![CDATA[We&#8217;ve all dealt with form validation one way or another and I didn&#8217;t find one to my liking. I was mulling over the idea of writing my own for a while and then I read Ajaxian&#8217;s blog today about a really awesome MooTools form validation class from MooTools.Floor. MooTools.Floor actually announced their FormCheck v1.4 form [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve all dealt with form validation one way or another and I didn&#8217;t find one to my liking. I was mulling over the idea of writing my own for a while and then I read <a href="http://ajaxian.com/archives/formcheck-great-form-validation-for-mootools" target="_blank">Ajaxian&#8217;s blog today about a really awesome MooTools form validation class</a> from <a href="http://mootools.floor.ch/en/" target="_blank">MooTools.Floor</a>. <a href="http://mootools.floor.ch/en/" target="_blank">MooTools.Floor</a> actually <a href="http://mootools.floor.ch/blog/?p=23" target="_blank">announced</a> their FormCheck v1.4 form validation class in July 25, 2008.<span id="more-82"></span></p>
<p>MooTools.Floor was nice enough to post <a href="http://mootools.floor.ch/docs/formcheck/files/formcheck-js.html" target="_blank">documentation</a> for the class, though there&#8217;s a lot of options to go through.</p>
<p>Errors appear in tools tips, form submission via ajax is available, error messages can be customizable, the options are endless! Like I said, there are lots of options.</p>
<p>To set whether an input, textarea, or select element needs to validate, you give the element a class property:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;text&quot; class=&quot;validate['required','length[4, -1]','differs[email]','digit']&quot; name=&quot;test_field&quot; value=&quot;&quot; /&gt;</pre></td></tr></table></div>

<p>To set up a form, you instantiate the MooTools class:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myCheck <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> FormCheck<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'form_id'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
    tipsClass <span style="color: #339933;">:</span> <span style="color: #3366CC;">'tips_box'</span><span style="color: #339933;">,</span>
        display <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
            scrollToFirst <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        alerts <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
            required <span style="color: #339933;">:</span> <span style="color: #3366CC;">'This field is ablolutely required! Please enter a value'</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><a href="http://www.garrickcheung.com/wp-content/uploads/formcheck.jpg" target="_blank"><img src="http://www.garrickcheung.com/wp-content/uploads/formcheck.jpg" alt="Screenshot of MooTools.Floor's FormCheck v1.4" style="width:455px;" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/mootoolsfloor-does-form-validation-right/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

