<?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>Unwrongest &#187; form</title>
	<atom:link href="http://www.unwrongest.com/tag/form/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unwrongest.com</link>
	<description>Interaction Designer and Interface Developer</description>
	<lastBuildDate>Wed, 30 Jun 2010 11:24:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Why are we typing passwords twice?</title>
		<link>http://www.unwrongest.com/blog/why-are-we-typing-passwords-twice/</link>
		<comments>http://www.unwrongest.com/blog/why-are-we-typing-passwords-twice/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 18:35:25 +0000</pubDate>
		<dc:creator>Jan Jarfalk</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.unwrongest.com/?p=502</guid>
		<description><![CDATA[We are typing passwords twice because of legacy design patterns we forgot to abandon. There is no reason for why everybody should suffer just because a few can't type their password correctly. I jump confirmation ship!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created about ten sign-up forms the last year and all of them has a &#8220;Confirm password&#8221;-input. My only sure reasons for that extra input field are habit and preconceived ideas. </p>
<h2>We are typing our passwords twice because</h2>
<p>To find out the reason for the &#8220;confirm password&#8221; input field I did some light Googling. This is why other people adds an extra password field to their sign up forms. </p>
<p><strong>a)</strong> We use this as confirmation that we typed what we meant to type.<br />
<strong>b)</strong> It is a convention, it is what we expect and therefor get.<br />
<strong>c)</strong> Web developers are bad habit forming idiots with preconceived ideas<br />
<strong>d)</strong> if we type it twice we are more likely to remember it.</p>
<h2>I am a combination</h2>
<p>For me it is a combination. A is probably the original thought behind it, but it is also something that I just expect to be there. But I also think it&#8217;s legacy design. Something I should have abandon years ago, or at least when I learned to create a better solution of my own.</p>
<h3>A &#8211; Confirmation</h3>
<p>My guesstimate is that most people actually do type their passwords correctly, even if they only see stars or bullets. If they don&#8217;t, they will probably find out soon enough and use the &#8220;I forgot my password&#8221;-link. I don&#8217;t think everybody should suffer just because a few can&#8217;t type their password correctly.</p>
<h3>B &#8211; Convention </h3>
<p>It is actually not so much a convention now days as it might have been a couple of years ago. Just look at <a href="http://virb.com/join" target="_ new">Virb</a> or <a href="http://www.facebook.com" target="_ new">Facebook</a>.</p>
<h3>C &#8211; Idiocy</h3>
<p>Most web developers aren&#8217;t idiots, but there are somethings we, I at least, do without thinking much about it. One of those things is probably creating an extra input and force you to type your password twice. </p>
<h3>D &#8211; Memory</h3>
<p>No.</p>
<h2>Instead of confirm password</h2>
<p>One solution is to just kill that extra input, like Virb and Facebook have done. Another is to replace it with a &#8220;Show Password&#8221;-checkbox using the <a href="http://www.unwrongest.com/projects/show-password/">Show Password</a> Jquery plugin.</p>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.showpassword.html"></iframe></p>
<p>People who want a confirmation that they spelled their password correctly can tick the checkbox. Others can ignore it. And that I like, stuff you can ignore if it doesn&#8217;t concern you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unwrongest.com/blog/why-are-we-typing-passwords-twice/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t stop password masking; let the user decide</title>
		<link>http://www.unwrongest.com/blog/dont-stop-password-masking-let-the-user-decide/</link>
		<comments>http://www.unwrongest.com/blog/dont-stop-password-masking-let-the-user-decide/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 14:51:17 +0000</pubDate>
		<dc:creator>Jan Jarfalk</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.unwrongest.com/?p=468</guid>
		<description><![CDATA[<a href="http://www.unwrongest.com/projects/show-password/">'Show password'</a> is a small and simple Jquery plugin that let your users decide whether they want their password fields masked or not. ]]></description>
			<content:encoded><![CDATA[<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.showpassword.html"></iframe></p>
<p>Jacob Nielsen&#8217;s blog post <a href="http://www.useit.com/alertbox/passwords.html" target="_new">&#8216;Stop password masking&#8217;</a> stirred up quite the discussion and divided the web developers into three camps; Stop masking, Don&#8217;t stop masking and Do both!.</p>
<p>I&#8217;m definitely in favor of &#8216;Do both!&#8217; and letting the user decide whether she wants her passwords masked or not. It is very simple to do and it&#8217;s fairly common concept; just look at the screen-shot of the Networks Preferences in Mac OS X above. The same thing can also be found in Microsoft Windows.</p>
<p>The demo in the Iframe above uses the very simple and lightweight Jquery plugin called &#8216;Show password&#8217;. You can get it from the <a href="http://www.unwrongest.com/projects/show-password/">&#8216;Show password&#8217;-project page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unwrongest.com/blog/dont-stop-password-masking-let-the-user-decide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Show password &#8211; Show or mask password checkbox Jquery plugin</title>
		<link>http://www.unwrongest.com/projects/show-password/</link>
		<comments>http://www.unwrongest.com/projects/show-password/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 14:39:33 +0000</pubDate>
		<dc:creator>Jan Jarfalk</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.unwrongest.com/?p=479</guid>
		<description><![CDATA[‘Show password’ is a small and simple Jquery plugin that let your users decide whether they want their password fields masked or not. ]]></description>
			<content:encoded><![CDATA[<p>&#8220;Usability suffers when users type in passwords and the only feedback they get is a row of bullets. Typically, masking passwords doesn&#8217;t even increase security, but it does cost you business due to login failures.&#8221; &#8211;  Jacob Nielsen, <a href="http://www.useit.com/alertbox/passwords.html">Stop password masking</a>.</p>
<p>This Jquery plugin, &#8216;Show password&#8217;, let the user decide whether they want their passwords masked or not. Just take a look at the demo beneath and you&#8217;ll see what I mean.  </p>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.showpassword.html"></iframe></p>
<h2>How to implement</h2>
<p>Very simple! First you <a href="http://showpassword.googlecode.com/files/jquery.showpassword-1.0.js">download</a>, then you do like this:</p>
<pre class="brush: xml;">
&lt;input id=&quot;text&quot; type=&quot;password&quot; /&gt;
&lt;input id=&quot;checkbox&quot; type=&quot;checkbox&quot; /&gt;&lt;label&gt;Show password&lt;/label&gt;
</pre>
<p>Two html elements are needed; a password field and a checkbox. Then you add the javascript below and change #text and #checkbox to the names of your input IDs.</p>
<pre class="brush: jscript;">
 $('#text').showPassword('#checkbox');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.unwrongest.com/projects/show-password/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>You can&#8217;t validate email addresses with regular expressions</title>
		<link>http://www.unwrongest.com/blog/email-validation-regular-expressions/</link>
		<comments>http://www.unwrongest.com/blog/email-validation-regular-expressions/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 17:54:30 +0000</pubDate>
		<dc:creator>Jan Jarfalk</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.unwrongest.com/?p=351</guid>
		<description><![CDATA[There is no way of validating email addresses using regular expressions, but regexps and emails are still a useful mix. You can use a javascript email validation regexp to provide useful user feedback and prevent unnecessary typos.]]></description>
			<content:encoded><![CDATA[<p>There are several reasons to why there cannot be a perfect regular expression for validating email addresses. Firstly; the official standard, RFC 2822, just tells the basic email address syntax; john@doe.superman is a valid email address according to RFC 2822. Also the standard support characters, like &#8221; and [, that some email clients can't handle.</p>
<p>Secondly and more importantly; even if the email matches a perfect regular expression, there are no guarantees that the email address belongs to the user, or even exists.</p>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.valid8.email.html"></iframe></p>
<p>With all that said I still believe live javascript-based email address checking using regular expressions is a good idea. You can use it to prevent users from doing unnecessary typos. You don't have to force them to pass the validation, just let them know if you suspect the email to be faulty. Try the demo, created with the Jquery plugin <a href="http://www.unwrongest.com/projects/valid8/">Valid8</a>, above and you will see what I mean.</p>
<pre class="brush:js">
/^[a-z0-9!#$%&#038;'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&#038;'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel.ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|.fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|.il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)\b$/
</pre>
<p>Above is the regular expression I use. It is heavily based on a regexp from <a href="http://www.regular-expressions.info/email.html">regular-expressions.info</a></p>
<h2>How do I validate email addresses if not with regular expressions?</h2>
<p>Sending an email activation link is a perfect way of validating an email address. You email a link the user have to click on to complete the registration. The link should be disposable and often look like this: http://www.unwrongest.com/signup/?guid=8373629375284563</p>
<h2>Never trust client-side validation</h2>
<p>Lastly. Remember that you can never, ever, trust client-side javascript validation. It is very easy to tamper with. All validation you do on the client-side has to be done again on the server-side. Client-side validation should be mainly for the users sake.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unwrongest.com/blog/email-validation-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Limit &#8211; Limit the number of characters in a textarea jQuery plugin</title>
		<link>http://www.unwrongest.com/projects/limit/</link>
		<comments>http://www.unwrongest.com/projects/limit/#comments</comments>
		<pubDate>Wed, 06 May 2009 06:03:18 +0000</pubDate>
		<dc:creator>Jan Jarfalk</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://unwr/?p=92</guid>
		<description><![CDATA[Limit is a plugin for the javascript framework Jquery that limits the number of characters that can be entered in a textarea or input field. The plugin can also report the number of characters left before the user reaches the length limit.]]></description>
			<content:encoded><![CDATA[<p>Limit is a plugin for the javascript framework Jquery that limits the number of characters that can be entered in a textarea or input field. The plugin can also report the number of characters left before the user reaches the length limit.</p>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 200px;" src="http://sandbox.unwrongest.com/forms/jquery.limit.html"></iframe> </p>
<h2>How to use Limit</h2>
<p>To use the full power of Limit you need two html elements; one textarea or input field and an element to show amount of characters left. </p>
<pre class="brush: xml;">
You have &lt;span id=&quot;charsLeft&quot;&gt;&lt;/span&gt; chars left.
&lt;textarea id=&quot;myTextarea&quot;&gt;&lt;/textarea&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $('#myTextarea').limit('140','#charsLeft');
&lt;/script&gt;
</pre>
<p>If you don&#8217;t want to show the amount of characters left you can do like this.</p>
<pre class="brush: xml;">
&lt;textarea id=&quot;myTextarea&quot;&gt;&lt;/textarea&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $('#myTextarea').limit('140');
&lt;/script&gt;
</pre>
<table class="project-table">
<caption>Change log</caption>
<thead>
<tr>
<th class="version">Version</th>
<th class="changes">Changes</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.2</td>
<td>Optimized timed function and fixed an issue with flickering text</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.unwrongest.com/projects/limit/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Valid8 &#8211; An input field validation plugin for Jquery</title>
		<link>http://www.unwrongest.com/projects/valid8/</link>
		<comments>http://www.unwrongest.com/projects/valid8/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 03:28:45 +0000</pubDate>
		<dc:creator>Jan Jarfalk</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://unwr/?p=164</guid>
		<description><![CDATA[Valid8 solves both simple and complex validation scenarios. Everything from a basic required field to regular expressions, ajax requests and arbitrary javascript functions. There is nothing you can't validate using Valid8.]]></description>
			<content:encoded><![CDATA[<div style="text-align: center; background: #FFBFBF; border: 1px solid #CF1919; padding: 20px; color: #3F0404; margin: 0 0 20px;">
Sunday, 23 June 2009<br />I am currently rewriting this documentation.<br />New segments will pop-up as I write them.<br/>I will twitter with janjarfalk as soon as I am done.</div>
<p>Valid8 features support for three types of validation techniques; Regular expressions, custom javascript functions and Ajax requests. The three techniques can be combined in any way you want. For example, in a very extreme case, you can use two regular expressions, one javascript function and three ajax requests for validating a single input field.</p>
<ol>
<dt>1) <a href="#regexp">Regular expressions</a></dt>
<dd>For determining whether a value matches a regular expresion. For example determining if a user name consists of only letters and numbers.</dd>
<dt>2) <a href="#js">Javascript functions</a></dt>
<dd>Send one or multiple values to a custom function. For example checking if the &#8216;password&#8217; and the &#8216;confirm password&#8217; input field matches each other.</dd>
<dt>3) <a href="#ajax">Ajax requests</a></dt>
<dd>Post one or multiple values to a external file. For example to see if a user name already exists in the database.</dd>
</ol>
<h2>Examples and demos</h2>
<p>Valid8 ranges from super simple &#8216;making an input field required&#8217; to an near endless possibility of complexity. I think the best way for me to describe how Valid8s individual parts is by showing you a set of examples.</p>
<ol>
<dt><a href="#">How to make an input field required</a></dt>
<dd>This example will show you how to make an input field required and show the default validation message &#8216;Required&#8217; if the field is left empty.</dd>
<dt><a href="#">How to make an input field required and show a custom error message</a></dt>
<dd>This example will show you how to make an input field required and show a custom validation message if the field is left empty.</dd>
<dt><a href="#">How to validate with a single regular expression</a></dt>
<dd>This example will show you how to validate using a regular expression that dictates that the input field(s) only can contain letters and numbers.</dd>
<dt><a href="#">How to validate with multiple regular expressions</a></dt>
<dd>This example will show you how to validate using two regular expressions. One that dictates that the input field is required and one  that the input field only can contain letters and numbers. Valid8 will show a different validation message depending on which regular expression it violates first. </dd>
<dt><a href="#">How to validate with a javascript function</a></dt>
<dd>This is example will show you how to compare the Password field with the Confirm Password field and make Confirm Passoword invalid if it doesn&#8217;t match the Password field.</dd>
<dt><a href="#">How to validate using an ajax request</a></dt>
<dd>This example will show you how to make see if an email address already is in your database.</dd>
</ol>
<h2>Example &#8211; How to make an input field required</h2>
<p>Calling the valid8 method without any arguments will show the default validation error message &#8216;Required&#8217; if the input field is left empty.</p>
<pre class="brush: jscript;">
    $('#inputUsername').valid8();
</pre>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.valid8.basic.html"></iframe> </p>
<div class="hr">
<hr /></div>
<h2>Example &#8211; How to make an input field required and show a custom error message</h2>
<p>Calling the valid8 method with a string as an argument will show the string as an a validation error message if the input field is left empty.</p>
<pre class="brush: jscript;">
    $('#inputUsername').valid8('Username is required');
</pre>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.valid8.basic2.html"></iframe> </p>
<div class="hr">
<hr /></div>
<h2>Example &#8211; How to validate with a single regular expression</h2>
<p>The example below is using a regular expression that dictates that the input field(s) only can contain a-z, A-Z and 0-9. If the value contains for example the character &#8216;@&#8217; the validation message &#8216;You can only use the letters A-Z and numbers&#8217; will be shown.</p>
<pre class="brush: jscript;">
    $('#inputUsername').valid8({
        'regularExpressions': [
            { expression: /^[a-zA-Z0-9]+$/, errormessage: 'You can only use the letters A-Z and numbers'}
        ]
    });
</pre>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.valid8.regexp.html"></iframe> </p>
<div class="hr">
<hr /></div>
<h2>Example &#8211; How to validate with multiple regular expressions</h2>
<p>The example below is using two regular expressions that dictates that the input field(s) not can be empty and only can contain a-z, A-Z and 0-9. If the value contains for example the character &#8216;@&#8217; the validation message &#8216;You can only use the letters A-Z and numbers&#8217; will be shown. If the field is left completely empty it will show the validation message &#8216;Field is required&#8217;.</p>
<pre class="brush: jscript;">
    $('#inputUsername').valid8({
        'regularExpressions': [
	    { expression: /^.+$/, errormessage: 'Username is required'},
        { expression: /^[a-zA-Z0-9]+$/, errormessage: 'You can only use the letters A-Z and numbers'}
        ]
    });
</pre>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.valid8.regexp2.html"></iframe> </p>
<div class="hr">
<hr /></div>
<h2>Example &#8211; How to validate with a javascript function</h2>
<p>In this example validates the input field &#8216;#inputPasswordVerification&#8217; and see if it matches the input field &#8216;#inputPassword&#8217;. If it doesn&#8217;t match the validation message &#8216;Passwords does not match&#8217; will be shown.</p>
<pre class="brush: jscript;">
function doesPasswordFieldsMatch(values){
    if(values.password == values.verification)
        return {valid:true}
    else
        return {valid:false, message:'Passwords does not match'}
}

$('#inputPassword').valid8('Password is required');
$('#inputConfirmPassword').valid8({
    'jsFunctions': [
        { function: doesPasswordFieldsMatch, values: function(){
                return { password: $('#inputPassword').val(), verification: $('#inputConfirmPassword').val() }
            }
        }
    ]
});
</pre>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 210px;" src="http://sandbox.unwrongest.com/forms/jquery.valid8.js.html"></iframe> </p>
<div class="hr">
<hr /></div>
<h2>Example &#8211; How to validate with an ajax request</h2>
<p>This example will post the value of the input field &#8216;#inputEmail&#8217; to isEmailUnique.php. </p>
<pre class="brush: jscript;">
	$('#inputEmail').valid8({
	    'regularExpressions': [
	        { expression: /^[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/, errormessage: 'Email is not valid'},
            ],
	    'ajaxRequests': [
	        { url: 'lib/isEmailUnique.php' }
	    ]
	});
</pre>
<pre class="brush: php;">
$email = $_POST['value'];

if(!isEmailUnique($email)){
	$json[&quot;valid&quot;] = false;
	$json[&quot;message&quot;] = 'Email is already in use';
}
else {
	$json[&quot;valid&quot;] = true;
}

function isEmailUnique($email){
	// Database look-up should go here here...
	// But for the sake of this demo a random return will do
	return rand(0, 1);
}

print json_encode($json);
</pre>
<p><iframe id="demo" style="border: 1px solid #ccc; width: 620px; height: 140px;" src="http://sandbox.unwrongest.com/forms/jquery.valid8.ajax.html"></iframe></p>
<div class="hr">
<hr /></div>
<table class="project-table">
<caption>Change log</caption>
<thead>
<tr>
<th class="version">Version</th>
<th class="changes">Changes</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.3</td>
<td>Valid8 now uses triggers instead of callback functions</td>
</tr>
<tr>
<td>1.2.2</td>
<td>Fixed a bug related to checkbox validation</td>
</tr>
<tr>
<td>1.2.1</td>
<td>Fixed a bug in IE7</td>
</tr>
<tr>
<td>1.2</td>
<td>Faster, harder, stronger.</td>
</tr>
<tr>
<td>1.1.2</td>
<td>Fixed a spelling mistake</td>
</tr>
<tr>
<td>1.1.1</td>
<td>Fixed a bug where white-spaces would pass the default validation regexp. (Thanks to Srinivas Tamada for reporting the bug)</td>
</tr>
<tr>
<td>1.1</td>
<td>Changed the variable validationEvent to validationEvents. It can now take both strings (eg. &#8216;keyup&#8217;) and arrays with strings (eg: ['keyup','blur']).</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.unwrongest.com/projects/valid8/feed/</wfw:commentRss>
		<slash:comments>60</slash:comments>
		</item>
		<item>
		<title>Defaultvalue &#8211; Gives value to empty inputs jQuery plugin</title>
		<link>http://www.unwrongest.com/projects/defaultvalue/</link>
		<comments>http://www.unwrongest.com/projects/defaultvalue/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 04:01:33 +0000</pubDate>
		<dc:creator>Jan Jarfalk</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://unwr/?p=177</guid>
		<description><![CDATA[Defaultvalue is a Jquery plugin that sets a default value on your input elements if they are empty. The default value disappears if the input gain focus or the user types something in it. Perfect for label values like "Search here...", "Username" or example values like "john.doe@corp.com". Works with both text and password inputs as well as textareas.]]></description>
			<content:encoded><![CDATA[<h2>How to use Defaultvalue</h2>
<p>There are two ways of using Defaultvalue. The first one is the, according to w3c, pure one. The second one is in some cases the right way to go.</p>
<h3>The first way</h3>
<p>In the pure one you set the default value, the value you want to show when the input element is empty, in the javascript. For every default value you need to call the defaultValue function.</p>
<pre class="brush:html">
<input type="text" id="inputUsername" />
<input type="password" id="inputPassword" />
</pre>
<pre class="brush:javascript">
$('#inputUsername').defaultValue({'value':'Username'});
$('#inputPassword').defaultValue({'value':'Password'});
</pre>
<h3>The second way</h3>
<p>The second way of using Defaultvalue is in some cases the easiest approach, but it is not according to w3c&#8217;s recommendations. It does not validate since it makes use of the rel attribute. First off the rel attribute should be used to state a relation, secondly the input element doesn&#8217;t even have a rel attribute. But, it works&#8230; even in Internet Explorer 6.</p>
<p>You state the default value directly in the html using the inputs rel attribute. In the javascript you only need to call the defaultValue function once.</p>
<pre class="brush: xml;">
&lt;input type=&quot;text&quot; id=&quot;inputUsername&quot; rel=&quot;Username&quot; /&gt;
&lt;input type=&quot;password&quot; id=&quot;inputPassword&quot; rel=&quot;Password&quot; /&gt;
</pre>
<pre class="brush: jscript;">
$('input').defaultValue();
</pre>
<h2>Empty input fields has the class name &#8216;empty&#8217;</h2>
<p>When the default value is shown the class name &#8216;empty&#8217; is added to the field. Take a look at the <a href="http://sandbox.unwrongest.com/jquery.defaultvalue/">demo</a> and see how the default values differs from the user created values.</p>
<h2>Password fields manipulate the DOM</h2>
<p>Since you can&#8217;t change the type of an input field in Internet Explorer, Defaultvalue creates a clone of your password field but with the type text instead.</p>
<table class="project-table">
<caption>Change log</caption>
<thead>
<tr>
<th class="version">Version</th>
<th class="changes">Changes</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.3.1</td>
<td>Fixed Lazy compatibility (Thanks Anders Adlén)</td>
</tr>
<tr>
<td>1.3</td>
<td>Refactored (Thanks Kristofer Karlsson)</td>
</tr>
<tr>
<td>1.2</td>
<td>Fixed an &#8216;addClass&#8217; is not a function error (Thanks pentarim)</td>
</tr>
<tr>
<td>1.1</td>
<td>Refactored. Default values are now removed when closest form is submitted. Fixed tabindex issue. (Thanks a lot to Paul Elliott)</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.unwrongest.com/projects/defaultvalue/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
