<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'Jquery Limit Input to Numbers'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Thu, 20 Jun 2013 10:40:40 GMT</pubDate>
<item>
<title>analogNerd said on 6/26/12</title>
<link>http://snipplr.com/view/8213/jquery-limit-input-to-numbers/</link>
<description><![CDATA[ Forgive the lack of formatting, this was my first post and I'm not used to Markdown.

    $('input.valid-number').bind('keypress', function(e) {   
        return (e.which === 8 || e.which === 0 || (e.shiftKey === false &amp;&amp; (e.which > 47 &amp;&amp; e.which < 58))) ? true : false;   
    } ]]></description>
<pubDate>Tue, 26 Jun 2012 06:42:25 GMT</pubDate>
<guid>http://snipplr.com/view/8213/jquery-limit-input-to-numbers/</guid>
</item>
<item>
<title>analogNerd said on 6/26/12</title>
<link>http://snipplr.com/view/8213/jquery-limit-input-to-numbers/</link>
<description><![CDATA[ This code won't catch the alternate values on the numeric keys. For example, #, ! and @ will all be allowed as the key pressed for these is still the number key. 

I changed the code to account for this as follows:

$('input.valid-number').bind('keypress', function(e) { 
          return (e.which === 8 || e.which === 0 || (e.shiftKey === false &amp;&amp; (e.which > 47 &amp;&amp; e.which < 58))) ? true : false;
} ]]></description>
<pubDate>Tue, 26 Jun 2012 06:30:10 GMT</pubDate>
<guid>http://snipplr.com/view/8213/jquery-limit-input-to-numbers/</guid>
</item>
</channel>
</rss>