Textbox that accepts decimal numbers only + jQuery
<p>I have following jQuery function to make textbox accepting only decimal number, but problem is it didn't accept <code>.</code> , so it works as only integer textbox,</p>

<p>I don't want to use any plugin</p>

<p>here is the jQuery function :</p>

<pre><code>$(document).ready(function () {
    $("#textbox1").keydown(function(event)
    {
        if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 ||
        (event.keyCode == 65 &amp;&amp; event.ctrlKey === true))
        {
            return;
        }
        else if(event.keyCode == 46)
        {
            return;
        }
        else 
        {
            if ((event.keyCode &lt; 48 || event.keyCode &gt; 57) &amp;&amp; 
                (event.keyCode &lt; 96 || event.keyCode &gt; 105 ))
            {
                event.preventDefault(); 
            }   
        }        
    });
});​
</code></pre>

<p><a href="http://jsfiddle.net/VKrLx/" rel="nofollow">Fiddle is here</a></p>
