Regex for negative decimal values client and server side c# jquery
<p>I have a keypress function bound to an element, this element needs to only allow positive and negative decimal characters. i.e. 0-9, '.' , '-'</p>

<p>any other characters I need to prevent the character being inputted</p>

<p>Is there any way to achieve this in the current keypress function</p>

<pre><code> $('.test').keyup(function (event) {

     //if character is NOT ok i.e. 0-9, '.' , '-'
     //STOP
     ..ELSE
    //continue to do something

});
</code></pre>

<p>P.s. I am using jquery</p>
