JQuery Keyboard events & Rejex logic need help
<p>I have TextBox in which user can type only Aplhabets(Lower&amp;Upper), Hypen (-), BackSpace only. These will be basically any Qualified URL name page like Contact/my-contact etc</p>

<p><strong>I need Rejex and restriction of keyboard keys on that Textbox</strong>.</p>

<p>For keyboard logic below code is not working properly as well so need help</p>

<pre><code>jQuery('#UrlName').keypress(function (e) {
    code = e.keyCode ? e.keyCode : e.which;
    if ((code.toString() &gt; 45 || code.toString() &lt; 57) &amp;&amp; (code.toString() &lt; 97 || code.toString() &gt; 122)) return false;
});
</code></pre>
