<?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>Images and Words</title>
	<atom:link href="http://www.e3webdesigns.com/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.e3webdesigns.com/wordpress</link>
	<description>Web Development Tips and Tricks from the fringe.</description>
	<lastBuildDate>Thu, 27 Oct 2011 12:35:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>XML Introduction</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=436</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=436#comments</comments>
		<pubDate>Thu, 27 Oct 2011 12:34:30 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=436</guid>
		<description><![CDATA[<a href="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/xml.png"><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/xml.png" alt="XML Post Image" title="xml" width="340" height="175" class="alignleft size-full wp-image-445" /></a>

A brief introduction to XML and XSLT.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/xml.png" alt="XML Post Image" title="xml" width="340" height="175" class="alignleft size-full wp-image-445" /></p>
<div class="clear"></div>
<h4>The XML:</h4>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;breakfast_menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Belgian Waffles<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$5.95<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>two of our famous Belgian Waffles with plenty of real maple syrup<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>650<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Strawberry Belgian Waffles<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$7.95<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>light Belgian waffles covered with strawberries and whipped cream<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>900<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Berry-Berry Belgian Waffles<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$8.95<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>light Belgian waffles covered with an assortment of fresh berries and whipped cream<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>900<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>French Toast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$4.50<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>thick slices made from our homemade sourdough bread<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>600<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Homestyle Breakfast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$6.95<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>two eggs, bacon or sausage, toast, and our ever-popular hash browns<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>950<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/calories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/food<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/breakfast_menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h4>The XSLT:</h4>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xsl:version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;font-family:Arial;font-size:12pt;background-color:#EEEEEE&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:for-each</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;breakfast_menu/food&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;background-color:teal;color:white;padding:4px&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;font-weight:bold&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;name&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        - <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;price&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;margin-left:20px;margin-bottom:1em;font-size:10pt&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;description&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;font-style:italic&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;calories&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> (calories per serving)
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:for-each<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h4>XML with XSLT Applied:</h4>
<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/xml.jpg" alt="Pic of XML with XSLT applied" title="xml" width="682" height="281" class="alignleft size-full wp-image-438" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=436</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery Password Validator</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=426</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=426#comments</comments>
		<pubDate>Fri, 21 Oct 2011 11:30:18 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=426</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/passval.png" alt="Password Validator with Jquery" title="passval" width="340" height="175" class="alignleft size-full wp-image-427" />

<p>A simple and attractive password validator based on a common pattern with visual notifications of successful input.</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/passval.png" alt="Password Validator with Jquery" title="passval" width="340" height="175" class="alignleft size-full wp-image-427" /></p>
<div class="clear"></div>
<h4>The HTML:</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;rules&quot;&gt;
&lt;ul&gt;
&lt;li id=&quot;lowercase&quot;&gt;Two lowercase letters (a-z)&lt;/li&gt;
&lt;li id=&quot;uppercase&quot;&gt;Two uppercase letters (A-Z)&lt;/li&gt;
&lt;li id=&quot;numbers&quot;&gt;Two numbers (0-9)&lt;/li&gt;
&lt;li id=&quot;special&quot;&gt;Two special characters from these choices: !@#$&lt;/li&gt;
&lt;li id=&quot;atleast&quot;&gt;At least 15 characters in length&lt;/li&gt;
&lt;li id=&quot;norepeat&quot;&gt;No repeating characters&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;form&quot;&gt;
&lt;label for=&quot;password&quot;&gt;Create Password:&lt;/label&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;span class=&quot;pass error&quot;&gt;&lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; maxlength=&quot;20&quot;&gt;&lt;/span&gt;
&lt;/div&gt;</pre></div></div>

<h4>The CSS:</h4>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#form</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>	
<span style="color: #00AA00;">&#125;</span>
label<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>	
<span style="color: #00AA00;">&#125;</span>
input<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">350px</span><span style="color: #00AA00;">;</span>	
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.error<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #933;">30px</span> <span style="color: #933;">4px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#69c</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/help.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">98%</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.showError<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #933;">30px</span> <span style="color: #933;">4px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#933</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">98%</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.showCheck<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #933;">30px</span> <span style="color: #933;">4px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#3C6</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/accept.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">98%</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#rules</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">427px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/bg.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#rules</span> ul<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">75px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#rules</span> ul li<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>	
<span style="color: #00AA00;">&#125;</span>
.check<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/accept.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.nocheck<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h4>The Script:</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;../pathToYourJqueryLibrary.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#password'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> pass <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#password'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> passLen <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#password'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> repeats <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/(.)\1/</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>passLen <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#lowercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#uppercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#numbers'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#special'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#atleast'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.pass'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'showError'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'showCheck'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#norepeat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#norepeat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nocheck'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#norepeat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nocheck'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#norepeat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>repeats.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//if repeating characters are found</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#norepeat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//if the li element already has the class 'check' attached</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#norepeat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nocheck'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//if the li element does not have the 'check' class attached</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#norepeat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nocheck'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//This will stop all remaining code from running if it finds repeating characters</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>validateLower<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//if two lower case characters are found</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#lowercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//if the li element already has the 'check' class, do nothing</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#lowercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#lowercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>validateUpper<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#uppercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#uppercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#uppercase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>validateNum<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#numbers'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#numbers'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#numbers'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>validateSpec<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#special'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#special'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#special'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>passLen <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">14</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#atleast'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#atleast'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#atleast'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>validatePass<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.pass'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'error'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'showCheck'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.pass'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'error'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.pass'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'error'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'showError'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.pass'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'showCheck'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.pass'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'showCheck'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'showError'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> validatePass<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> filter <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^(?=(?:.*[a-z]){2})(?=(?:.*[A-Z]){2})(?=(?:.*\d){2})(?=(?:.*[!@#$]){2}).{15,20}$/</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>filter.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> validateLower<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> filter <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^(?=(?:.*[a-z]){2}).*$/</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>filter.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> validateUpper<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> filter <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^(?=(?:.*[A-Z]){2}).*$/</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>filter.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> validateNum<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> filter <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^(?=(?:.*[0-9]){2}).*$/</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>filter.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> validateSpec<span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> filter <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^(?=(?:.*[!@#$]){2}).*$/</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>filter.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>pass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>The Screenshot:</h4>
<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/passvalpic.png" alt="Password Validator Screenshot" title="passvalpic" width="417" height="364" class="alignleft size-full wp-image-431" /></p>
<div class="clear"></div>
<p>Explanation Coming Soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=426</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regular Expression Top Ten List</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=406</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=406#comments</comments>
		<pubDate>Thu, 20 Oct 2011 11:05:43 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=406</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/regextop10.png" alt="Regular Expression Top 10 List" title="regextop10" width="340" height="175" class="alignleft size-full wp-image-421" />

<p>10 Java Regular Expressions you should add to your arsenal.  You never know when you might need one of these bad boys!</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/regextop10.png" alt="Regular Expression Top 10 List" title="regextop10" width="340" height="175" class="alignleft size-full wp-image-421" /></p>
<div class="clear"></div>
<h3>Regular Expressions</h3>
<p>Def. In computing, a regular expression provides a concise and flexible means for &#8220;matching&#8221; (specifying and recognizing) strings of text, such as particular characters, words, or patterns of characters.</p>
<h4>1. Username</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span><span style="color: #009900;">&#91;</span>a<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span>_<span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #CC0000;">3</span><span style="color: #339933;">,</span><span style="color: #CC0000;">15</span><span style="color: #009900;">&#125;</span>$</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span>                    # Start of the line
  <span style="color: #009900;">&#91;</span>a<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span>_<span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span>	     # Match characters and symbols <span style="color: #000066; font-weight: bold;">in</span> the list<span style="color: #339933;">,</span> a<span style="color: #339933;">-</span>z<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span> <span style="color: #339933;">,</span> underscore <span style="color: #339933;">,</span> hyphen
             <span style="color: #009900;">&#123;</span><span style="color: #CC0000;">3</span><span style="color: #339933;">,</span><span style="color: #CC0000;">15</span><span style="color: #009900;">&#125;</span>  # Length at least <span style="color: #CC0000;">3</span> characters and maximum length of <span style="color: #CC0000;">15</span> 
$                    # End of the line</pre></div></div>

<h4>2. Password</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span>\d<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#91;</span>a<span style="color: #339933;">-</span>z<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Z<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">@</span>#$<span style="color: #339933;">%</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #009900;">&#123;</span><span style="color: #CC0000;">6</span><span style="color: #339933;">,</span><span style="color: #CC0000;">20</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span>			# Start of group
  <span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span>\d<span style="color: #009900;">&#41;</span>		#   must contains one digit from <span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span>
  <span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#91;</span>a<span style="color: #339933;">-</span>z<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>		#   must contains one lowercase characters
  <span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Z<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>		#   must contains one uppercase characters
  <span style="color: #009900;">&#40;</span><span style="color: #339933;">?=</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">@</span>#$<span style="color: #339933;">%</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>		#   must contains one special symbols <span style="color: #000066; font-weight: bold;">in</span> the list <span style="color: #3366CC;">&quot;@#$%&quot;</span>
              .		#     match anything <span style="color: #000066; font-weight: bold;">with</span> previous condition checking
                <span style="color: #009900;">&#123;</span><span style="color: #CC0000;">6</span><span style="color: #339933;">,</span><span style="color: #CC0000;">20</span><span style="color: #009900;">&#125;</span>	#        length at least <span style="color: #CC0000;">6</span> characters and maximum of <span style="color: #CC0000;">20</span>	
<span style="color: #009900;">&#41;</span>			# End of group</pre></div></div>

<h4>3. Hexadecimal Color Code</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span>#<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Fa<span style="color: #339933;">-</span>f0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #CC0000;">6</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Fa<span style="color: #339933;">-</span>f0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>$</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span>		 #start of the line
 #		 #  must constains a <span style="color: #3366CC;">&quot;#&quot;</span> symbols
 <span style="color: #009900;">&#40;</span>		 #  start of group #<span style="color: #CC0000;">1</span>
  <span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Fa<span style="color: #339933;">-</span>f0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #CC0000;">6</span><span style="color: #009900;">&#125;</span> #    any strings <span style="color: #000066; font-weight: bold;">in</span> the list<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">with</span> length of <span style="color: #CC0000;">6</span>
  <span style="color: #339933;">|</span>		 #    ..<span style="color: #660066;">or</span>
  <span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Fa<span style="color: #339933;">-</span>f0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#125;</span> #    any strings <span style="color: #000066; font-weight: bold;">in</span> the list<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">with</span> length of <span style="color: #CC0000;">3</span>
 <span style="color: #009900;">&#41;</span>		 #  end of group #<span style="color: #CC0000;">1</span> 
$		 #end of the line</pre></div></div>

<h4>4. Email</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span><span style="color: #009900;">&#91;</span>_A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>\\.<span style="color: #009900;">&#91;</span>_A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*@</span><span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>
<span style="color: #009900;">&#40;</span>\\.<span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>\\.<span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>$</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span>			#start of the line
  <span style="color: #009900;">&#91;</span>_A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>	#  must start <span style="color: #000066; font-weight: bold;">with</span> string <span style="color: #000066; font-weight: bold;">in</span> the bracket <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> must contains one or more <span style="color: #009900;">&#40;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#40;</span>			#  start of group #<span style="color: #CC0000;">1</span>
    \\.<span style="color: #009900;">&#91;</span>_A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #339933;">-</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>	#     follow by a dot <span style="color: #3366CC;">&quot;.&quot;</span> and string <span style="color: #000066; font-weight: bold;">in</span> the bracket <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> must contains one or more <span style="color: #009900;">&#40;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>			#  end of group #<span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span> group <span style="color: #000066; font-weight: bold;">is</span> optional <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">@</span>			#     must contains a <span style="color: #3366CC;">&quot;@&quot;</span> symbol
     <span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>       #        follow by string <span style="color: #000066; font-weight: bold;">in</span> the bracket <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> must contains one or more <span style="color: #009900;">&#40;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#40;</span>			#	   start of group #<span style="color: #CC0000;">2</span> <span style="color: #339933;">-</span> first level TLD checking
       \\.<span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z0<span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>  #	     follow by a dot <span style="color: #3366CC;">&quot;.&quot;</span> and string <span style="color: #000066; font-weight: bold;">in</span> the bracket <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> must contains one or more <span style="color: #009900;">&#40;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>		#	   end of group #<span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span> group <span style="color: #000066; font-weight: bold;">is</span> optional <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#40;</span>			#	   start of group #<span style="color: #CC0000;">3</span> <span style="color: #339933;">-</span> second level TLD checking
       \\.<span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Za<span style="color: #339933;">-</span>z<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #009900;">&#125;</span>  #	     follow by a dot <span style="color: #3366CC;">&quot;.&quot;</span> and string <span style="color: #000066; font-weight: bold;">in</span> the bracket <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">with</span> minimum length of <span style="color: #CC0000;">2</span>
      <span style="color: #009900;">&#41;</span>			#	   end of group #<span style="color: #CC0000;">3</span>
$			#end of the line</pre></div></div>

<h4>5. Image File Extension</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">^</span>\s<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>\.<span style="color: #009900;">&#40;</span><span style="color: #339933;">?</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jpg<span style="color: #339933;">|</span>png<span style="color: #339933;">|</span>gif<span style="color: #339933;">|</span>bmp<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>$<span style="color: #009900;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span>			#Start of the group #<span style="color: #CC0000;">1</span>
 <span style="color: #009900;">&#91;</span><span style="color: #339933;">^</span>\s<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>			#  must contains one or more anything <span style="color: #009900;">&#40;</span>except white space<span style="color: #009900;">&#41;</span>
       <span style="color: #009900;">&#40;</span>		#    start of the group #<span style="color: #CC0000;">2</span>
         \.		#	follow by a dot <span style="color: #3366CC;">&quot;.&quot;</span>
         <span style="color: #009900;">&#40;</span><span style="color: #339933;">?</span>i<span style="color: #009900;">&#41;</span>		#	ignore the <span style="color: #000066; font-weight: bold;">case</span> sensitive checking
             <span style="color: #009900;">&#40;</span>		#	  start of the group #<span style="color: #CC0000;">3</span>
              jpg	#	    contains characters <span style="color: #3366CC;">&quot;jpg&quot;</span>
              <span style="color: #339933;">|</span>		#	    ..<span style="color: #660066;">or</span>
              png	#	    contains characters <span style="color: #3366CC;">&quot;png&quot;</span>
              <span style="color: #339933;">|</span>		#	    ..<span style="color: #660066;">or</span>
              gif	#	    contains characters <span style="color: #3366CC;">&quot;gif&quot;</span>
              <span style="color: #339933;">|</span>		#	    ..<span style="color: #660066;">or</span>
              bmp	#	    contains characters <span style="color: #3366CC;">&quot;bmp&quot;</span>
             <span style="color: #009900;">&#41;</span>		#	  end of the group #<span style="color: #CC0000;">3</span>
       <span style="color: #009900;">&#41;</span>		#     end of the group #<span style="color: #CC0000;">2</span>	
  $			#  end of the string
<span style="color: #009900;">&#41;</span>			#end of the group #<span style="color: #CC0000;">1</span></pre></div></div>

<h4>6. IP Address</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #339933;">?</span>\\d\\d<span style="color: #339933;">?|</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span>\\d<span style="color: #339933;">|</span><span style="color: #CC0000;">25</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>\\.<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #339933;">?</span>\\d\\d<span style="color: #339933;">?|</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span>\\d<span style="color: #339933;">|</span><span style="color: #CC0000;">25</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>\\.
<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #339933;">?</span>\\d\\d<span style="color: #339933;">?|</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span>\\d<span style="color: #339933;">|</span><span style="color: #CC0000;">25</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>\\.<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #339933;">?</span>\\d\\d<span style="color: #339933;">?|</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span>\\d<span style="color: #339933;">|</span><span style="color: #CC0000;">25</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>$</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">^</span>		#start of the line
 <span style="color: #009900;">&#40;</span>		#  start of group #<span style="color: #CC0000;">1</span>
   <span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #339933;">?</span>\\d\\d<span style="color: #339933;">?</span> #    Can be one or two digits. <span style="color: #000066; font-weight: bold;">If</span> three digits appear<span style="color: #339933;">,</span> it must start either <span style="color: #CC0000;">0</span> or <span style="color: #CC0000;">1</span>
		#    e.<span style="color: #660066;">g</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">|</span>		#    ...<span style="color: #660066;">or</span>
   <span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span>\\d	#    start <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> follow by <span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">4</span> and end <span style="color: #000066; font-weight: bold;">with</span> any digit <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> 
    <span style="color: #339933;">|</span>           #    ...<span style="color: #660066;">or</span>
   <span style="color: #CC0000;">25</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span>      #    start <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> follow by <span style="color: #CC0000;">5</span> and end <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">25</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> 
 <span style="color: #009900;">&#41;</span>		#  end of group #<span style="color: #CC0000;">2</span>
  \.            #  follow by a dot <span style="color: #3366CC;">&quot;.&quot;</span>
....            # repeat <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">3</span> time <span style="color: #009900;">&#40;</span>3x<span style="color: #009900;">&#41;</span>
$		#end of the line</pre></div></div>

<h4>7. Time Format</h4>
<p>12-Hour:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#91;</span>012<span style="color: #009900;">&#93;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span>\\s<span style="color: #009900;">&#41;</span><span style="color: #339933;">?</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>am<span style="color: #339933;">|</span>pm<span style="color: #009900;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span>				#start of group #<span style="color: #CC0000;">1</span>
 <span style="color: #CC0000;">1</span><span style="color: #009900;">&#91;</span>012<span style="color: #009900;">&#93;</span>				#  start <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">11</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">12</span>
 <span style="color: #339933;">|</span>				#  or
 <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>				#  start <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span>...<span style="color: #CC0000;">9</span>
<span style="color: #009900;">&#41;</span>				#end of group #<span style="color: #CC0000;">1</span>
 <span style="color: #339933;">:</span>				#    follow by a semi colon <span style="color: #009900;">&#40;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>			#   follow by <span style="color: #CC0000;">0</span>..<span style="color: #CC0000;">5</span> and <span style="color: #CC0000;">0</span>..<span style="color: #CC0000;">9</span><span style="color: #339933;">,</span> which means 00 to <span style="color: #CC0000;">59</span>
            <span style="color: #009900;">&#40;</span>\\s<span style="color: #009900;">&#41;</span><span style="color: #339933;">?</span>		#        follow by a white space <span style="color: #009900;">&#40;</span>optional<span style="color: #009900;">&#41;</span>
                  <span style="color: #009900;">&#40;</span><span style="color: #339933;">?</span>i<span style="color: #009900;">&#41;</span>		#          next checking <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #000066; font-weight: bold;">case</span> insensitive
                      <span style="color: #009900;">&#40;</span>am<span style="color: #339933;">|</span>pm<span style="color: #009900;">&#41;</span>	#            follow by am or pm</pre></div></div>

<p>24-hour:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #339933;">?</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">|</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span>				#start of group #<span style="color: #CC0000;">1</span>
 <span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #339933;">?</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>			#  start <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #339933;">,</span>00<span style="color: #339933;">-</span>09<span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #339933;">-</span><span style="color: #CC0000;">19</span>
 <span style="color: #339933;">|</span>				#  or
 <span style="color: #CC0000;">2</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span>				#  start <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">-</span><span style="color: #CC0000;">23</span>
<span style="color: #009900;">&#41;</span>				#end of group #<span style="color: #CC0000;">1</span>
 <span style="color: #339933;">:</span>				#  follow by a semi colon <span style="color: #009900;">&#40;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>			#    follow by <span style="color: #CC0000;">0</span>..<span style="color: #CC0000;">5</span> and <span style="color: #CC0000;">0</span>..<span style="color: #CC0000;">9</span><span style="color: #339933;">,</span> which means 00 to <span style="color: #CC0000;">59</span></pre></div></div>

<h4>8. Date Format (dd/mm/yyyy)</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">?</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">12</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">|</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">?</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">|</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#91;</span>012<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">19</span><span style="color: #339933;">|</span><span style="color: #CC0000;">20</span><span style="color: #009900;">&#41;</span>\\d\\d<span style="color: #009900;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span>			#start of group #<span style="color: #CC0000;">1</span>
 <span style="color: #CC0000;">0</span><span style="color: #339933;">?</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>		#  01<span style="color: #339933;">-</span>09 or <span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span>
 <span style="color: #339933;">|</span>                  	#  ..<span style="color: #660066;">or</span>
 <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">12</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>		#  <span style="color: #CC0000;">10</span><span style="color: #339933;">-</span><span style="color: #CC0000;">19</span> or <span style="color: #CC0000;">20</span><span style="color: #339933;">-</span><span style="color: #CC0000;">29</span>
 <span style="color: #339933;">|</span>			#  ..<span style="color: #660066;">or</span>
 <span style="color: #CC0000;">3</span><span style="color: #009900;">&#91;</span>01<span style="color: #009900;">&#93;</span>			#  <span style="color: #CC0000;">30</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">31</span>
<span style="color: #009900;">&#41;</span> 			#end of group #<span style="color: #CC0000;">1</span>
  <span style="color: #339933;">/</span>			#  follow by a <span style="color: #3366CC;">&quot;/&quot;</span>
   <span style="color: #009900;">&#40;</span>			#    start of group #<span style="color: #CC0000;">2</span>
    <span style="color: #CC0000;">0</span><span style="color: #339933;">?</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>		#	01<span style="color: #339933;">-</span>09 or <span style="color: #CC0000;">1</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span>
    <span style="color: #339933;">|</span>			#	..<span style="color: #660066;">or</span>
    <span style="color: #CC0000;">1</span><span style="color: #009900;">&#91;</span>012<span style="color: #009900;">&#93;</span>		#	<span style="color: #CC0000;">10</span><span style="color: #339933;">,</span><span style="color: #CC0000;">11</span><span style="color: #339933;">,</span><span style="color: #CC0000;">12</span>
    <span style="color: #009900;">&#41;</span>			#    end of group #<span style="color: #CC0000;">2</span>
     <span style="color: #339933;">/</span>			#	follow by a <span style="color: #3366CC;">&quot;/&quot;</span>
      <span style="color: #009900;">&#40;</span>			#	  start of group #<span style="color: #CC0000;">3</span>
       <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">19</span><span style="color: #339933;">|</span><span style="color: #CC0000;">20</span><span style="color: #009900;">&#41;</span>\\d\\d	#	    <span style="color: #CC0000;">19</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span> or <span style="color: #CC0000;">20</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">-</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#93;</span>
       <span style="color: #009900;">&#41;</span>		#	  end of group #<span style="color: #CC0000;">3</span></pre></div></div>

<h4>9. HTML Tag</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;[^&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color: #3366CC;">&quot;|'[^']*'|[^'&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>	  	#start <span style="color: #000066; font-weight: bold;">with</span> opening tag <span style="color: #3366CC;">&quot;&lt;&quot;</span>
 <span style="color: #009900;">&#40;</span>		#   start of group #<span style="color: #CC0000;">1</span>
   <span style="color: #3366CC;">&quot;[^&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color: #3366CC;">&quot;	#	only two double quotes are allow - &quot;</span>string<span style="color: #3366CC;">&quot;
   |		#	..or
   '[^']*'	#	only two single quotes are allow - 'string'
   |		#	..or
   [^'&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#93;</span>	#	cant contains one single quotes<span style="color: #339933;">,</span> double quotes and <span style="color: #3366CC;">&quot;&gt;&quot;</span>
 <span style="color: #009900;">&#41;</span>		#   end of group #<span style="color: #CC0000;">1</span>
 <span style="color: #339933;">*</span>		# <span style="color: #CC0000;">0</span> or more
<span style="color: #339933;">&gt;</span>		#end <span style="color: #000066; font-weight: bold;">with</span> closing tag <span style="color: #3366CC;">&quot;&gt;&quot;</span></pre></div></div>

<h4>10. HTML Links</h4>
<p>HTML A tag:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #339933;">?</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span>a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">^&gt;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">+?</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span>		#start of group #<span style="color: #CC0000;">1</span>
 <span style="color: #339933;">?</span>i		#  all checking are <span style="color: #000066; font-weight: bold;">case</span> insensive
<span style="color: #009900;">&#41;</span>		#end of group #<span style="color: #CC0000;">1</span>
<span style="color: #339933;">&lt;</span>a              #start <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #3366CC;">&quot;&lt;a&quot;</span>
  <span style="color: #009900;">&#40;</span>		#  start of group #<span style="color: #CC0000;">2</span>
    <span style="color: #009900;">&#91;</span><span style="color: #339933;">^&gt;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>	#     anything except <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> at least one character
   <span style="color: #009900;">&#41;</span>		#  end of group #<span style="color: #CC0000;">2</span>
  <span style="color: #339933;">&gt;</span>		#     follow by <span style="color: #3366CC;">&quot;&gt;&quot;</span>
    <span style="color: #009900;">&#40;</span>.<span style="color: #339933;">+?</span><span style="color: #009900;">&#41;</span>	#	match anything 
         <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>	#	  end <span style="color: #000066; font-weight: bold;">with</span> <span style="color: #3366CC;">&quot;&lt;/a&gt;</span></pre></div></div>

<p>Extract HTML link:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">\s<span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?</span>i<span style="color: #009900;">&#41;</span>href\s<span style="color: #339933;">*=</span>\s<span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>\<span style="color: #3366CC;">&quot;([^&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span>\<span style="color: #3366CC;">&quot;)|'[^']*'|([^'&quot;</span><span style="color: #339933;">&gt;</span>\s<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">\s<span style="color: #339933;">*</span>			   #can start <span style="color: #000066; font-weight: bold;">with</span> whitespace
  <span style="color: #009900;">&#40;</span><span style="color: #339933;">?</span>i<span style="color: #009900;">&#41;</span>			   # all checking are <span style="color: #000066; font-weight: bold;">case</span> insensive
     href		   #  follow by <span style="color: #3366CC;">&quot;href&quot;</span> word
        \s<span style="color: #339933;">*=</span>\s<span style="color: #339933;">*</span>		   #   allows spaces on either side of the equal sign<span style="color: #339933;">,</span>
              <span style="color: #009900;">&#40;</span>		   #    start of group #<span style="color: #CC0000;">1</span>
               <span style="color: #3366CC;">&quot;([^&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color: #3366CC;">&quot;)   #      only two double quotes are allow - &quot;</span>string<span style="color: #3366CC;">&quot;
               |	   #	  ..or
               '[^']*'	   #      only two single quotes are allow - 'string'
               |           #	  ..or
               ([^'&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span>   #     cant contains one single <span style="color: #339933;">/</span> double quotes and <span style="color: #3366CC;">&quot;&gt;&quot;</span>
	      <span style="color: #009900;">&#41;</span>		   #    end of group #<span style="color: #CC0000;">1</span></pre></div></div>

<p>Go get some!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=406</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New HTML5 Structure</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=396</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=396#comments</comments>
		<pubDate>Tue, 18 Oct 2011 11:20:08 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=396</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/html5.png" alt="" title="html5" width="340" height="175" class="alignleft size-full wp-image-402" />

<p>HTML5 is easier than you might think.  Why wait?  Start using the new structures today!</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/html5.png" alt="" title="html5" width="340" height="175" class="alignleft size-full wp-image-402" /></p>
<div class="clear"></div>
<p>HTML5 was designed with backwards compatibility in mind.  The new semantic markups and the new doctype and overall document structure can be used right now with no negative effects on your new or previous work.  Unlike JavaScript and CSS, where additions are only supported when browser makers implement them into their parsers, there&#8217;s no need to wait on new browser versions to be released before using HTML5&#8242;s new syntax.</p>
<p>Let&#8217;s take a look at the new HTML5 document structure.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot; /&gt;
&lt;title&gt;HTML 5 Rocks!&lt;/title&gt;
&lt;meta name=&quot;description&quot; content=&quot;Cool Site&quot;&gt;
&lt;meta name=&quot;author&quot; content=&quot;Doc&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/default.css&quot; /&gt;
&nbsp;
&lt;!--[if lt IE 9]&gt;
&lt;script src=&quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&nbsp;
&lt;!-- Your content here --&gt;
&nbsp;
&lt;script src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Let&#8217;s break it down, shall we?</p>
<h4>The DOCTYPE</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html&gt;</pre></div></div>

<p>First we have the doctype which tells the browser and other parsers which version and flavor of HTML this document is using.  Because browsers have to support all existing content on the web, there&#8217;s nor reliance on the doctype to tell them which features should be supported in a given document.  The 15 characters that make up the new doctype declaration are the minimum characters required to get every browser to display a page in standards mode. Browsers have never required the lengthy doctype declarations of XHTML Strict and HTML4 Transitional in order to display a page correctly. The only way you trigger quirks mode now is to eliminate a doctype altogether.</p>
<h4>The HTML tag</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;</pre></div></div>

<p>The xmlns is no longer necessary for the page to validate.  The attribute &#8216;lang&#8217; is not required either.</p>
<h4>The Meta tag</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;meta charset=&quot;utf-8&quot; /&gt;
&lt;title&gt;HTML 5 Rocks!&lt;/title&gt;
&lt;meta name=&quot;description&quot; content=&quot;Cool Site&quot;&gt;
&lt;meta name=&quot;author&quot; content=&quot;Doc&quot;&gt;</pre></div></div>

<p>The meta tag has been greatly simplified.  In nearly all cases, utf-8 is the value you&#8217;ll be using in you documents.  The entire character encoding declaration must be included within the first 512 characters of your document.  It should appear before any content-based elements (like the &#8216;title&#8217; element).</p>
<h4>The CSS declaration</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;css/default.css&quot; /&gt;</pre></div></div>

<p>In the style sheet declaration the type=&#8221;text/css&#8221; was never a requirement with HMTL4 or XHTML, even when using the strict doctypes.  So we don&#8217;t need it here because all browsers recognize the content of linked stylesheets without requiring the extra attribute.  In CSS when a new feature is added it also has to be added to the browser&#8217;s rendering engines.  So, older browsers won&#8217;t recognize new CSS features.</p>
<h4>The HTML Shiv</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!--[if lt IE 9]&gt;
&lt;script src=&quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;</pre></div></div>

<p>Prior to IE 9, IE prevented unrecognized elements from receiving styles.  These mystery elements were seen by the rendering engine as &#8220;unknown elements&#8221;, so you were unable to change they way they looked or behaved.  This includes made up elements (like &#8216;recipe&#8217;, or &#8216;ziggy&#8217;) but also any elements which had yet to be defined at the time those browser versions were developed.  This includes all the new HTML5 elements.  A very simple piece of JavaScript called the HTML5 Shiv makes new and mystery elements visible to older version of IE.  It needs to be wrapped in conditional comments to target IE versions less than IE 9.</p>
<h4>External JavaScript sources</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;jquery.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>Javascript is the only real scripting language used on the web, and all browsers will assume you are using JavaScript even when you don&#8217;t declare that fact.  So they &#8216;type&#8217; attribute is not required in the &#8216;script&#8217; tag.  We&#8217;ve put the script tag at the bottom of our page to conform to best practices for embedding JavaScript.  This has to do with the page loading speed; when a browser encounters a script it will stop loading the page until it parses the entire script.  Scripts placed at the bottom of the page will be parsed after the page has fully loaded.  In some cases, like the HTML5 Shiv, the script needs to be placed in the head tag of your document because you want it to take effect before the browser starts rendering the page.</p>
<p>This is a quick intro; more to come!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=396</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Friendly prompts for your users</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=385</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=385#comments</comments>
		<pubDate>Fri, 14 Oct 2011 18:53:58 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Cascading Style Sheets]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=385</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/val.png" alt="jQuery Validation with pretty images" title="val" width="340" height="175" class="alignleft size-full wp-image-388" />

<p>A cool and stylish way to provide guidance for your users.</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/val.png" alt="jQuery Validation with pretty images" title="val" width="340" height="175" class="alignleft size-full wp-image-388" /></p>
<div class="clear"></div>
<p>There are numerous methods that guide your users through your online forms.  Popup dialog, colorful borders around text fields that are empty or not in the correct format, hidden divs or spans that come in and out of view based on user input, etc.  We&#8217;ve seen it all.</p>
<p>This is a neat little method that I like to use.  It&#8217;s low impact, very little code overhead and it just looks streamlined and professional.</p>
<p>But I&#8217;m biased, so you decide for yourself.</p>
<p>Consider the following very scaled down example:</p>
<h4>The HTML</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;button class=&quot;wrapMe&quot; id=&quot;wrapMe&quot;&gt;Validate Me!&lt;/button&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;new1&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;fname&quot; id=&quot;fname&quot; /&gt;
&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;new2&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;lname&quot; id=&quot;lname&quot; /&gt;
&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;new3&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; /&gt;
&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;</pre></div></div>

<h4>The CSS:</h4>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">button<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
input<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.new1</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.new2</span><span style="color: #00AA00;">,</span> .new3<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">30px</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.newer1<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">30px</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#3C6</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/accept.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">95%</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.newer2<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">30px</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#933</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">95%</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.newer3<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">30px</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#3C6</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/accept.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">95%</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h4>The jQuery:</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#wrapMe'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.new1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.new1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'newer1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.new2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.new2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'newer2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.new3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.new3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'newer3'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>All that&#8217;s taking place here is a style swap on the divs that surround the input elements.  At first they are unseen because they are not styled to be seen.  Then the bare bones style is removed and a new one is added with background colors and little icons that tell the end user if they have provided acceptable information or not.</p>
<p>Peace!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=385</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate Email with jQuery and JavaScript RegExp</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=373</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=373#comments</comments>
		<pubDate>Fri, 14 Oct 2011 12:04:16 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=373</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/validate.png" alt="Validate email address" title="validate" width="340" height="175" class="alignleft size-full wp-image-380" />

<p>The title of this post says it all.  Let's check it out!</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/validate.png" alt="Validate email address" title="validate" width="340" height="175" class="alignleft size-full wp-image-380" /></p>
<div class="clear"></div>
<p>I often like to scrub user input before it even hits the processing page or a database.  This is good practice as it ensures the user has provided the requested information in the correct format and using the correct data types for the input fields.</p>
<p>Email validation is quite simple, and there are various stages at which we can check the user provided input to see if it follows the standard email format.  We could check the user input when our user navigates away from the input field (Blur or onChange).  We could check when the user submits the form by calling a function onSubmit.  I like to attach a function to the email input field that checks on each keystroke, and when the format is satisfied give the user a visual prompt to tell them they got it right.  Remember to include the jQuery library in order to use the scripts that follow.</p>
<p>Consider the following simple input text field:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;emailAddress&quot; /&gt;</pre></div></div>

<p>The id attribute will be used to &#8220;hook&#8221; into the function via jQuery.  Next we build a keyup function that will perform a task each time the user releases a key on the keyboard within the email text field only.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#emailAddress'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>     
     <span style="color: #003366; font-weight: bold;">var</span> email <span style="color: #339933;">==</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#emailAddress'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>validateEmail<span style="color: #009900;">&#40;</span>email<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
          $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'background-color'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'green'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
          $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'background-color'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'red'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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></div></div>

<p>This block of code says that each time the user performs a keyup on the html element with and id of &#8216;emailAddress&#8217;, then run the code within the keyup function.  It first sets a variable called &#8216;email&#8217; to the value of the emailAddress input text field.  It will need this value to compare it to the email format in the next function.  The next function is valled validateEmail.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> validateEmail<span style="color: #009900;">&#40;</span>email<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> filter <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>filter.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>email<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This block of code is doing some pretty heavy stuff if you&#8217;ve never seen it before.  Let&#8217;s tear it up.</p>
<p>The validateEmail function is called from within the first block of code each time the user performs a keyup within the email input text field.  It passes the current value of the email input text field into the validateEmail function which performs a test on it using the filter variable.  The filter variable provides the structure for a valid email address.</p>
<p>If the current value of the user provided data does not match the filter structure, then we get a return false back to the keyup function.  The conditional statement will fall through to else and the background color of the input text field will be red; a visual cue to the user that they have not yet provided a valid email address.</p>
<p>As soon as they provide the validateEmail function with a valid email that matches the structure of the filter variable, the conditional statement in the first function will be satisfied and it will change the color of the input text field to green; a visual cue that the user has provided a valid email.</p>
<p>Try it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=373</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sticky Footer</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=360</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=360#comments</comments>
		<pubDate>Fri, 14 Oct 2011 11:04:05 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=360</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/sticky.png" alt="Sticky Footer Logo" title="sticky" width="340" height="175" class="alignleft size-full wp-image-369" />

<p>A neat little piece of code that forces your footer to "stick" to the bottom of the page regardless of page content.</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/sticky.png" alt="Sticky Footer Logo" title="sticky" width="340" height="175" class="alignleft size-full wp-image-369" /></p>
<div class="clear"></div>
<h4>Basic HTML structure</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;wrap&quot;&gt;
     &lt;div id=&quot;header&quot;&gt;
     &lt;/div&gt;
     &lt;div id=&quot;main&quot;&gt;
     &lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;footer&quot;&gt;
&lt;/div&gt;</pre></div></div>

<h4>The CSS Code:</h4>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">html<span style="color: #00AA00;">,</span> body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#wrap</span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#main</span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">150px</span><span style="color: #808080; font-style: italic;">/*must be the same as the footer height*/</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">-150px</span><span style="color: #00AA00;">;</span><span style="color: #808080; font-style: italic;">/*negative value of footer height*/</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=360</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We are here, we are here, we are here!</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=344</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=344#comments</comments>
		<pubDate>Thu, 13 Oct 2011 11:46:26 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=344</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/img_wrap.png" alt="jQuery write less do more" title="jQuery Logo" width="340" height="175" class="alignnone size-full wp-image-310" />

<p>Can jQuery tell us if an element exists withing our page?  Ummmm, yep!</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/img_wrap.png" alt="jQuery write less do more" title="jQuery Logo" width="340" height="175" class="alignnone size-full wp-image-310" /></p>
<div class="clear"></div>
<p>So, let&#8217;s say you&#8217;re trying to count the number of divs on your page, for whatever reason your project involves.  jQuery has a handful of ways to accomplish this, for this example we are going to be playing around with the length property.</p>
<p>Consider the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div&gt;
&lt;img src=&quot;images/pretty_cow.jpg&quot; /&gt;  
&lt;div id=&quot;data&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&nbsp;
&lt;script type=&quot;text/javascript&quot;&gt;  
if ($('img').length) { // implies *not* zero    
log('We found img elements on the page using &quot;img&quot;');  
} else {    
log('No img elements found');  
}    
&nbsp;
if ($(':input').length != 0) {    
log('Found an input-type element using &quot;:input&quot;');  
} else {    
log('No input-type elements found');  
}    
&nbsp;
log('Looking for &quot;div img&quot;, found ' + $('div').find('img').length); 
&nbsp;
function log(msg) {    
$('#debug').append('&lt;p&gt;' + msg + '&lt;/p&gt;');  
}
&lt;/script&gt;</pre></div></div>

<p>Let&#8217;s break it down! The log function is simply outputting the string that we are providing to it, and then appends a paragraph element with a message to the div element with the id of &#8216;data&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> log<span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>    
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#data'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;p&gt;'</span> <span style="color: #339933;">+</span> msg <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We have a div that includes an &#8216;img&#8217; tag, and a div with an id of &#8216;data&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div&gt;
&lt;img src=&quot;images/pretty_cow.jpg&quot; /&gt;  
&lt;div id=&quot;data&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>The first conditional statement in the script is saying if the number of &#8216;img&#8217; elements found is not zero then pass the first string to the log function, else pass the second string.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// implies *not* zero    </span>
log<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'We found img elements on the page using &quot;img&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>    
log<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'No img elements found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The next conditional statement is an example of failing to find the referenced element, in this case an &#8216;input&#8217; element.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">!=</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>    
log<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Found an input-type element using &quot;:input&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>    
log<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'No input-type elements found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Notice that using&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">!=</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>is the same as using&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span></pre></div></div>

<p>The final bit of code is a simple call to the log() function with a string outputting the findings of its search for &#8216;img&#8217; elements.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">log<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Looking for &quot;div img&quot;, found '</span> <span style="color: #339933;">+</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Easy huh?  Don&#8217;t feed the cow!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=344</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Shorthand Properties</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=334</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=334#comments</comments>
		<pubDate>Wed, 12 Oct 2011 11:14:07 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Cascading Style Sheets]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=334</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/css.png" alt="" title="css" width="340" height="175" class="alignnone size-full wp-image-323" />

<p>CSS Shorthand properties can be used to set several properties in one shot, in a single declaration.  Saves time and space in your document.  Sweet!</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/css.png" alt="" title="css" width="340" height="175" class="alignnone size-full wp-image-323" /></p>
<div class="clear"></div>
<p>Let&#8217;s get started!</p>
<h4>Colors</h4>
<p>The most widely used method for setting color properties is to use hexadecimal notation, which is an octothorpe (#) followed by six digits.  You can also use keywords and RGB notation.  When a color&#8217;s hexadecimal code is made up of three pairs of digits (such as #000000, or #FFFFFF) you can eliminate one digit from each pair.  So #000000 becomes #000, and #FFFFFF becomes #FFF, and #336699 becomes #369, etc.</p>
<h4>Box Dimensions</h4>
<p>All of the properties that affect box dimension share the same syntax: shorthand property followed by one to four space separated values:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">property<span style="color: #00AA00;">:</span> value1<span style="color: #00AA00;">;</span>
property<span style="color: #00AA00;">:</span> value1 value2<span style="color: #00AA00;">;</span>
property<span style="color: #00AA00;">:</span> value1 value2 value3<span style="color: #00AA00;">;</span>
property<span style="color: #00AA00;">:</span> value1 value2 value3 value4<span style="color: #00AA00;">;</span></pre></div></div>

<p>Which side of the box the values affect depends on how many values are specified.  Check it out:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">One value<span style="color: #00AA00;">:</span> all sides
Two values<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span> and <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">left</span> and <span style="color: #000000; font-weight: bold;">right</span>
Three values<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">right</span> and <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">bottom</span>
Four values<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">left</span></pre></div></div>

<h4>Margin and Padding</h4>
<p>This is a common method for providing margin settings:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">2em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>The following accomplishes the same settings:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2em</span> <span style="color: #933;">1em</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>The same system is used for padding properties as well.</p>
<h4>Borders</h4>
<p>Borders have size, style and color.  The defaults are medium for width (how wide depends on the user agent), none for style, and the color is determined by the color of the element you are setting the border on.  Order does not matter.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">border-width</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>This is the more efficient shorthand method:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span></pre></div></div>

<h4>Backgrounds</h4>
<p>This is a great time and space saver!</p>
<p>Consider the background properties:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f00</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">pathToImage/image.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span><span style="color: #993333;">no-repeat</span> <span style="color: #993333;">repeat-x</span> <span style="color: #993333;">repeat-y</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-attachment</span><span style="color: #00AA00;">:</span><span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> or <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>This can be greatly downsized to:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f00</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">pathToImage/image.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #993333;">fixed</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>The order these are in shouldn&#8217;t matter, but I would keep it as is.</p>
<p>These are the defaults for the background properties:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span>
image<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span>
<span style="color: #993333;">repeat</span><span style="color: #00AA00;">:</span><span style="color: #993333;">repeat</span> <span style="color: #00AA00;">&#40;</span>x and y<span style="color: #00AA00;">&#41;</span>
attachment<span style="color: #00AA00;">:</span><span style="color: #993333;">scroll</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #933;">0%</span> <span style="color: #933;">0%</span></pre></div></div>

<p>The following accomplish the same thing:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f00</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f00</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>Setting background colors in this manner will take precedence over a background image set by a previous rule.  Consider the following:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">p <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f00</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div p<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#0f0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>All paragraphs not in a div element will have a background image and be red where the image does not cover the background.  Any paragraph within a div will have a green background and no image.</p>
<h4>Fonts</h4>
<p>There are a lot of properties when dealing with fonts:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">italic</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-variant</span><span style="color: #00AA00;">:</span><span style="color: #993333;">small-caps</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">140%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span><span style="color: #ff0000;">&quot;Lucida Grande&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>And the shorthand for the above:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #993333;">italic</span> <span style="color: #993333;">small-caps</span> <span style="color: #993333;">bold</span> <span style="color: #933;">1em</span>/<span style="color: #933;">140%</span> <span style="color: #ff0000;">&quot;Lucida Grande&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>As aforementioned the order doesn&#8217;t really matter, but I would use the spec set forth by the W3C.  Remember, you MUST set values for font-size and font-family, and in that order.  The intial values for font properties are:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span>
<span style="color: #000000; font-weight: bold;">font-variant</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">medium</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:depends </span>on user agent</pre></div></div>

<h4>Lists</h4>
<p>These shorthand properties are for ordered and unordered lists:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">square</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">list-style-position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inside</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">list-style-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image.gif</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>And the shorthand:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">square</span> <span style="color: #993333;">inside</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">image.gif</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>This is not an exhaustive list of shorthand properties, as there are several more that are not widely used mainly because of poor browser support.  With the onset of HTML5, browser compatibility, and CSS3 I am confident this will soon change.  Go Standards!</p>
<p>Thanks for playing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=334</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery clone()</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=279</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=279#comments</comments>
		<pubDate>Thu, 06 Oct 2011 16:10:14 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=279</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/img_wrap.png" alt="jQuery write less do more" title="jQuery Logo" width="340" height="175" class="alignnone size-full wp-image-310" />
Let's clone some DOM elements with the jQuery Library, CSS2, and good old HTML!]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2011/10/img_wrap.png" alt="jQuery write less do more" title="jQuery Logo" width="340" height="175" class="alignnone size-full wp-image-310" /></p>
<div class="clear"></div>
<p>The Javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">&lt;script  type=&quot;text/javascript&quot; src=&quot;../jqueryUI/js/jquery-1.6.2.min.js&quot;&gt;&lt;/script&gt;
&nbsp;
&lt;script type=&quot;text/javascript&quot;&gt;
   $(document).ready(function(){
        $('#btnClone').click(function(){
          $('#cloneMe').clone().insertAfter('#cloneMe');
          return false;
        });
    });
  &lt;/script&gt;</pre></div></div>

<p>The CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">  &lt;style<span style="color: #00AA00;">&gt;</span>
  	<span style="color: #cc00cc;">#cloneMe</span><span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">dashed</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F90</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
	.<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>	
	<span style="color: #00AA00;">&#125;</span>
	input<span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>	
	<span style="color: #00AA00;">&#125;</span>
  &lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>The HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;body&gt;
&lt;h3&gt;This is an example of using the clone() method on elements with ID's.  Big difference!&lt;/h3&gt;
&nbsp;
  &lt;input type=&quot;button&quot; id=&quot;btnClone&quot; value=&quot;Clone Div&quot; /&gt;
&nbsp;
  &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&nbsp;
  &lt;div id=&quot;cloneMe&quot;&gt;
     &lt;h4&gt;Clone me bro!&lt;/h4&gt;
  &lt;/div&gt;
  &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&nbsp;
&lt;/body&gt;</pre></div></div>

<p>Get Cloning!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&#038;p=279</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

