<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
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/"
> <channel><title>Comments on: Masked Input Plugin 1.0</title> <atom:link href="http://digitalbush.com/2007/07/25/masked-input-plugin-10/feed/" rel="self" type="application/rss+xml" /><link>http://digitalbush.com/2007/07/25/masked-input-plugin-10/</link> <description>Tales of a Tormented Software Developer</description> <lastBuildDate>Tue, 07 Feb 2012 11:47:55 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>By: Geoff</title><link>http://digitalbush.com/2007/07/25/masked-input-plugin-10/comment-page-1/#comment-2403</link> <dc:creator>Geoff</dc:creator> <pubDate>Tue, 03 Feb 2009 23:33:36 +0000</pubDate> <guid
isPermaLink="false">http://digitalbush.com/2007/07/25/masked-input-plugin-10/#comment-2403</guid> <description>John,Terrific job on this awesome and helpful jQuery plugin. It works great. I&#039;m wondering if there&#039;s a better way to allow 15 OR 16 digits... for a single credit card field.For the benefit of future readers, AmEx cards have 15 digits, while Visa, MasterCard and Discover have 16. What I&#039;ve done is tweaked the code provided here, as well as add some other JavaScript that checks the card type and if it is AmEx then switches the mask applied to the field. Here&#039;s how I did it:First, add (to your masking code):$(&quot;#card_number&quot;).mask(&#039;xxxxxxxxxxxxxxxx&#039;);Then add (to var charMap, around line 65 of jquery.maskedinput-1.1.4.js):&#039;x&#039;:&quot;[0-9\\u2666]&quot;These two mods allow you to use numbers OR the Unicode Diamond Character in your mask... for obscuring the CC# onblur. I have another JS that performs a simple string.length and substring on the card number to change the first 12 chars to a diamond and store the real number in a hidden field.So, now we have to change the mask on the fly to 15 chars if the user wants to use an AmEx card. Here&#039;s where it would be helfpul to have OR syntax in the Regex... like [x]{15,16}?? I can&#039;t figure out how to put an OR in the mask.Anyway, here&#039;s the code that I found works (on FF3,Opera9,Win, but not Safari or Chrome).Add this after your jQuery includes and other JavaScripts in the head.function pickAmex()
{
jQuery.noConflict();(function($) {
$(function() {
$(&quot;#card_number&quot;).unmask();
$(&quot;#card_number&quot;).mask(&#039;xxxxxxxxxxxxxxx&#039;);
});
})(jQuery);
}
function pickNotAmex()
{
jQuery.noConflict();(function($) {
$(function() {
$(&quot;#card_number&quot;).unmask();
$(&quot;#card_number&quot;).mask(&#039;xxxxxxxxxxxxxxxx&#039;);
});
})(jQuery);
}You then put: onfocus=&quot;pickAmex()&quot; on the AmEx radio button, and onfocus=&quot;pickNotAmex()&quot; on the Visa, MC &amp; Discover buttons. Presto, the mask changes on the fly to 15 characters or 16 characters, respectively.If there&#039;s a better way to do this with better browser support, I&#039;m all ears!</description> <content:encoded><![CDATA[<p>John,</p><p>Terrific job on this awesome and helpful jQuery plugin. It works great. I&#8217;m wondering if there&#8217;s a better way to allow 15 OR 16 digits&#8230; for a single credit card field.</p><p>For the benefit of future readers, AmEx cards have 15 digits, while Visa, MasterCard and Discover have 16. What I&#8217;ve done is tweaked the code provided here, as well as add some other JavaScript that checks the card type and if it is AmEx then switches the mask applied to the field. Here&#8217;s how I did it:</p><p>First, add (to your masking code):</p><p>$(&#8220;#card_number&#8221;).mask(&#8216;xxxxxxxxxxxxxxxx&#8217;);</p><p>Then add (to var charMap, around line 65 of jquery.maskedinput-1.1.4.js):</p><p>&#8216;x&#8217;:&#8221;[0-9\\u2666]&#8221;</p><p>These two mods allow you to use numbers OR the Unicode Diamond Character in your mask&#8230; for obscuring the CC# onblur. I have another JS that performs a simple string.length and substring on the card number to change the first 12 chars to a diamond and store the real number in a hidden field.</p><p>So, now we have to change the mask on the fly to 15 chars if the user wants to use an AmEx card. Here&#8217;s where it would be helfpul to have OR syntax in the Regex&#8230; like [x]{15,16}?? I can&#8217;t figure out how to put an OR in the mask.</p><p>Anyway, here&#8217;s the code that I found works (on FF3,Opera9,Win, but not Safari or Chrome).</p><p>Add this after your jQuery includes and other JavaScripts in the head.</p><p>function pickAmex()<br
/> {<br
/> jQuery.noConflict();(function($) {<br
/> $(function() {<br
/> $(&#8220;#card_number&#8221;).unmask();<br
/> $(&#8220;#card_number&#8221;).mask(&#8216;xxxxxxxxxxxxxxx&#8217;);<br
/> });<br
/> })(jQuery);<br
/> }<br
/> function pickNotAmex()<br
/> {<br
/> jQuery.noConflict();(function($) {<br
/> $(function() {<br
/> $(&#8220;#card_number&#8221;).unmask();<br
/> $(&#8220;#card_number&#8221;).mask(&#8216;xxxxxxxxxxxxxxxx&#8217;);<br
/> });<br
/> })(jQuery);<br
/> }</p><p>You then put: onfocus=&#8221;pickAmex()&#8221; on the AmEx radio button, and onfocus=&#8221;pickNotAmex()&#8221; on the Visa, MC &amp; Discover buttons. Presto, the mask changes on the fly to 15 characters or 16 characters, respectively.</p><p>If there&#8217;s a better way to do this with better browser support, I&#8217;m all ears!</p> ]]></content:encoded> </item> <item><title>By: Sunil Kumar</title><link>http://digitalbush.com/2007/07/25/masked-input-plugin-10/comment-page-1/#comment-2096</link> <dc:creator>Sunil Kumar</dc:creator> <pubDate>Tue, 22 Jan 2008 15:25:02 +0000</pubDate> <guid
isPermaLink="false">http://digitalbush.com/2007/07/25/masked-input-plugin-10/#comment-2096</guid> <description>Good work with the plugin! I&#039;ve the same requirement as above where the user can enter a zip code with format 99999 or 99999-9999. Is there an either or option?</description> <content:encoded><![CDATA[<p>Good work with the plugin! I&#8217;ve the same requirement as above where the user can enter a zip code with format 99999 or 99999-9999. Is there an either or option?</p> ]]></content:encoded> </item> <item><title>By: Christian Ready</title><link>http://digitalbush.com/2007/07/25/masked-input-plugin-10/comment-page-1/#comment-93</link> <dc:creator>Christian Ready</dc:creator> <pubDate>Thu, 20 Sep 2007 17:58:31 +0000</pubDate> <guid
isPermaLink="false">http://digitalbush.com/2007/07/25/masked-input-plugin-10/#comment-93</guid> <description>I love your plugin. Very well done!  I am using to format phone numbers and I wanted to know if there was a way to optionally allow for extensions.  In other words, a user could enter this:555-555-5555but continue if he wanted to to enter this;555-555-5555 x5555Any ideas?</description> <content:encoded><![CDATA[<p>I love your plugin. Very well done!  I am using to format phone numbers and I wanted to know if there was a way to optionally allow for extensions.  In other words, a user could enter this:</p><p>555-555-5555</p><p>but continue if he wanted to to enter this;</p><p>555-555-5555 x5555</p><p>Any ideas?</p> ]]></content:encoded> </item> <item><title>By: Mike</title><link>http://digitalbush.com/2007/07/25/masked-input-plugin-10/comment-page-1/#comment-92</link> <dc:creator>Mike</dc:creator> <pubDate>Tue, 18 Sep 2007 14:11:19 +0000</pubDate> <guid
isPermaLink="false">http://digitalbush.com/2007/07/25/masked-input-plugin-10/#comment-92</guid> <description>Great plugin... just one question. How does the &quot;completed&quot; option work? I would like to alter the functionality so that if a field is incomplete, it doesn&#039;t erase everything in the field. Thanks.</description> <content:encoded><![CDATA[<p>Great plugin&#8230; just one question. How does the &#8220;completed&#8221; option work? I would like to alter the functionality so that if a field is incomplete, it doesn&#8217;t erase everything in the field. Thanks.</p> ]]></content:encoded> </item> <item><title>By: Sergi</title><link>http://digitalbush.com/2007/07/25/masked-input-plugin-10/comment-page-1/#comment-91</link> <dc:creator>Sergi</dc:creator> <pubDate>Wed, 12 Sep 2007 09:39:54 +0000</pubDate> <guid
isPermaLink="false">http://digitalbush.com/2007/07/25/masked-input-plugin-10/#comment-91</guid> <description>Hi! Your plugin is very good but it has one disadvatage. There are no user-defined validation. I think it will be nice
to add to argument settings field &#039;validate&#039;, that like a &#039;completed&#039; will represent a function returning boolean value and use it in checkVal like this
if(!s.match(re) &#124;&#124; (settings.validate &amp;&amp; !settings.validate(input)))</description> <content:encoded><![CDATA[<p>Hi! Your plugin is very good but it has one disadvatage. There are no user-defined validation. I think it will be nice<br
/> to add to argument settings field &#8216;validate&#8217;, that like a &#8216;completed&#8217; will represent a function returning boolean value and use it in checkVal like this<br
/> if(!s.match(re) || (settings.validate &amp;&amp; !settings.validate(input)))</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 2/12 queries in 0.005 seconds using apc

Served from: _ @ 2012-02-09 06:51:52 -->
