<?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>HTML form guide &#187; form widgets</title>
	<atom:link href="http://www.html-form-guide.com/blog/category/web-form-widget/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.html-form-guide.com/blog</link>
	<description>How to make good web forms</description>
	<lastBuildDate>Wed, 28 Apr 2010 11:41:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A rich password widget for your web forms</title>
		<link>http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/</link>
		<comments>http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 17:34:56 +0000</pubDate>
		<dc:creator>prasanth</dc:creator>
				<category><![CDATA[form widgets]]></category>
		<category><![CDATA[form password]]></category>
		<category><![CDATA[Web forms]]></category>

		<guid isPermaLink="false">http://www.html-form-guide.com/blog/?p=54</guid>
		<description><![CDATA[ 
		digg_url = "http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/";
	 
	Here is a password field widget that not only has a password strength meter but also has other essential features that your users would love to have.


Mask or unmask? Do passwords really have to look like **** ?
When you type-in your password, the password field shows a mask. This mask supposedly [...]]]></description>
			<content:encoded><![CDATA[<div id="socialize-in-content"><div class="socialize-in-button"><script type="text/javascript"> 
		digg_url = "http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/";
	</script> 
	<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div></div><p>Here is a password field widget that not only has a password strength meter but also has other essential features that your users would love to have.</p>
<p><img src="http://www.html-form-guide.com/blog/wp-content/uploads/2009/10/password-widget-1.png" alt="password-widget-1" width="185" height="77" class="alignnone size-full wp-image-75" /></p>
<p><span id="more-54"></span></p>
<h2>Mask or unmask? Do passwords really have to look like **** ?</h2>
<p>When you type-in your password, the password field shows a mask. This mask supposedly prevents someone from observing your screen &#8216;over the shoulder&#8217; . </p>
<p>But, what if I am at home with the only possible observer being my pet dog? Why not leave the option of showing/masking the password to me, the user?</p>
<p><img src="http://www.html-form-guide.com/blog/wp-content/uploads/2009/10/password-widget-2.png" alt="form password show/hide" width="377" height="105" class="alignnone size-full wp-image-76" /></p>
<h2>Need a strong password quickly? Generate it.</h2>
<p>There are <a href='http://mashable.com/2008/11/05/password-management-for-firefox-3/'>many good password managers available</a>. For those users, it will just be good to generate a password for the web site and then let the password manager remember it for life. Having a password generator along with the password field will be handy. </p>
<h2>Strength meter.</h2>
<p>Another common feature is to have a strength meter that persuades the user to have a better password rather than their pet name. Based on some basic rules (have a number and a symbol in the password) a strength value is displayed that, hopefully, will make the user create a better password. </p>
<h2>See the widget in action !</h2>
<p><!-- Smart Youtube --><span class="youtube"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/tU8IrwVvHNg&amp;rel=0&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;iv_load_policy=3&amp;showsearch=0" /><param name="allowFullScreen" value="true" /><embed wmode="transparent" src="http://www.youtube.com/v/tU8IrwVvHNg&amp;rel=0&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;iv_load_policy=3&amp;showsearch=0" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="355" ></embed><param name="wmode" value="transparent" /></object></span></p>
<h2>Try it yourself!</h2>
<p><a href="http://www.html-form-guide.com/demos/sample-reg-form.html">Password widget demo page</a></p>
<h2>Download</h2>
<p><a href="/downloads/PasswordWidget.zip">PasswordWidget.zip</a></p>
<p>The download contains the source and some samples.</p>
<h2>Usage</h2>
<p>The usage is simple.<br />
First, link to the style sheet and the JavaScript file:</p>

<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;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;STYLESHEET&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;pwdwidget.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;pwdwidget.js&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Instead of the password field, use the code below.</p>

<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;label</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">'regpwd'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Password:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</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;">class</span>=<span style="color: #ff0000;">'pwdwidgetdiv'</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">'thepwddiv'</span><span style="color: #000000; font-weight: bold;">&gt;</span><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;script</span>  <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
var pwdwidget = new PasswordWidget('thepwddiv','regpwd');
pwdwidget.MakePWDWidget();
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;noscript<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 style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'password'</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">'regpwd'</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'regpwd'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><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;/noscript<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Notice that noscript part makes sure that a normal password field is shown even if Java Script is disabled. </p>
<p>The parameters to the PasswordWidget() class are: (1)the ID of the div for the widget and (2)the name of the password field.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> pwdwidget <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PasswordWidget<span style="color: #009900;">&#40;</span>id_of_div<span style="color: #339933;">,</span>name_of_passwordfield<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>More options</h2>
<p>The features can be turned on/off. For example, it doesn&#8217;t make sense to have a &#8216;generate&#8217; option in a log-in form. Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> pwdwidget <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PasswordWidget<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'thepwddiv'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'regpwd'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">enableGenerate</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">enableShowStrength</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">MakePWDWidget</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Similarly, you can modify/translate the label text :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> pwdwidget <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PasswordWidget<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'thepwddiv'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'regpwd'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">txtShow</span><span style="color: #339933;">=</span> <span style="color: #3366CC;">'Display'</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">txtMask</span><span style="color: #339933;">=</span> <span style="color: #3366CC;">'Hide'</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">MakePWDWidget</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>License</h2>
<p><a href="http://www.gnu.org/copyleft/lesser.html"><img border='0' alt="" src="http://www.gnu.org/graphics/lgplv3-147x51.png" class="alignnone" width="147" height="51" /></a><br />
The Password widget is shared under LGPL license. You can freely use it on commercial or non-commercial websites.</p>
<p>The password widget was tested on IE7, FireFox 3, Opera 9.24, and Safari 3.1.<br />
Post your comments and suggestions. Translations and enhancements are also welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
