jQuery Characters Filter
<p>i'm using a jQuery <a href="https://github.com/akzhan/jquery-keyfilter/blob/master/index.html" rel="nofollow">character filter</a> , which works just fine on jsfiddle - 
<a href="http://jsfiddle.net/itamarperetz/VgjJs/1/" rel="nofollow">http://jsfiddle.net/itamarperetz/VgjJs/1/</a></p>

<p>I'm using the <strong>same code</strong> on my own computer ( so far i'm running the code on xampp, apache) , but it's not working at all-  i'm able to type whatever charcter I want (while in the jsfiddle i'm not able to type ".!$^$@$" etc , as expected.</p>

<p>*I've imported jQuery and checked that it's well imported.</p>

<pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;
&lt;/script&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1255"&gt;
&lt;title&gt;Insert title here&lt;/title&gt;

&lt;script type="text/javascript"&gt;
/*
 * This plugin filters keyboard input by specified regular expression.
 * Version 1.7
 * $Id$
 *
 * Source code inspired by Ext.JS (Ext.form.TextField, Ext.EventManager)
 *
 * Procedural style:
 * $('#ggg').keyfilter(/[\dA-F]/);
 * Also you can pass test function instead of regexp. Its arguments:
   * this - HTML DOM Element (event target).
   * c - String that contains incoming character.
 * $('#ggg').keyfilter(function(c) { return c != 'a'; });
 *
 * Class style:
 * &lt;input type="text" class="mask-num" /&gt;
 *
 * Available classes:
   * mask-pint:     /[\d]/
   * mask-int:      /[\d\-]/
   * mask-pnum:     /[\d\.]/
   * mask-money     /[\d\.\s,]/
   * mask-num:      /[\d\-\.]/
   * mask-hex:      /[0-9a-f]/i
   * mask-email:    /[a-z0-9_\.\-@]/i
   * mask-alpha:    /[a-z_]/i
   * mask-alphanum: /[a-z0-9_]/i
 */

(function($)
{
    var defaultMasks = {
        pint:     /[\d]/,
        'int':    /[\d\-]/,
        pnum:     /[\d\.]/,
        money:    /[\d\.\s,]/,
        num:      /[\d\-\.]/,
        hex:      /[0-9a-f]/i,
        email:    /[a-z0-9_\.\-@]/i,
        alpha:    /[a-z_]/i,
        alphanum: /[a-z0-9_]/i
    };

    var Keys = {
        TAB: 9,
        RETURN: 13,
        ESC: 27,
        BACKSPACE: 8,
        DELETE: 46
    };

    // safari keypress events for special keys return bad keycodes
    var SafariKeys = {
        63234 : 37, // left
        63235 : 39, // right
        63232 : 38, // up
        63233 : 40, // down
        63276 : 33, // page up
        63277 : 34, // page down
        63272 : 46, // delete
        63273 : 36, // home
        63275 : 35  // end
    };

    var isNavKeyPress = function(e)
    {
        var k = e.keyCode;
        k = $.browser.safari ? (SafariKeys[k] || k) : k;
        return (k &gt;= 33 &amp;&amp; k &lt;= 40) || k == Keys.RETURN || k == Keys.TAB || k == Keys.ESC;
    };

        var isSpecialKey = function(e)
    {
        var k = e.keyCode;
        var c = e.charCode;
        return k == 9 || k == 13 || (k == 40 &amp;&amp; (!$.browser.opera || !e.shiftKey)) || k == 27 ||
            k == 16 || k == 17 ||
            (k &gt;= 18 &amp;&amp; k &lt;= 20) ||
            ($.browser.opera &amp;&amp; !e.shiftKey &amp;&amp; (k == 8 || (k &gt;= 33 &amp;&amp; k &lt;= 35) || (k &gt;= 36 &amp;&amp; k &lt;= 39) || (k &gt;= 44 &amp;&amp; k &lt;= 45)))
            ;

        };

        /**
         * Returns a normalized keyCode for the event.
         * @return {Number} The key code
         */
        var getKey = function(e)
    {
        var k = e.keyCode || e.charCode;
        return $.browser.safari ? (SafariKeys[k] || k) : k;
        };

        var getCharCode = function(e)
    {
        return e.charCode || e.keyCode || e.which;
    };

    $.fn.keyfilter = function(re)
    {
        return this.keypress(function(e)
        {
            if (e.ctrlKey || e.altKey)
            {
                return;
            }
            var k = getKey(e);
            if($.browser.mozilla &amp;&amp; (isNavKeyPress(e) || k == Keys.BACKSPACE || (k == Keys.DELETE &amp;&amp; e.charCode == 0)))
            {
                return;
            }
            var c = getCharCode(e), cc = String.fromCharCode(c), ok = true;
            if(!$.browser.mozilla &amp;&amp; (isSpecialKey(e) || !cc))
            {
                return;
            }
            if ($.isFunction(re))
            {
                ok = re.call(this, cc);
            }
            else
            {
                ok = re.test(cc);
            }
            if(!ok)
            {
                e.preventDefault();
            }
        });
    };

    $.extend($.fn.keyfilter, {
        defaults: {
            masks: defaultMasks
        },
        version: 1.7
    });

    $(document).ready(function()
    {
        var tags = $('input[class*=mask],textarea[class*=mask]');
        for (var key in $.fn.keyfilter.defaults.masks)
        {
            tags.filter('.mask-' + key).keyfilter($.fn.keyfilter.defaults.masks[key]);
        }
    });

})(jQuery);​
&lt;/script&gt;




&lt;/head&gt;
&lt;body&gt;
&lt;label&gt;&lt;input type="text" class="mask-alphanum" /&gt; - mask-alphanum&lt;/label&gt;
​
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>If you've got any idea what might be the problem , any suggestion would be helpful !</p>

<p>Thanks in advance </p>
