How do I validate a decimal field with jquery and regex?
<p>this is what I have so far:</p>

<pre><code>$j(element)..keypress(function(e){
        var val = $j(this).val();
        if (("1234567890.").indexOf(e.charCode) &gt; -1){
            if (val.length &gt; 0){
                var regex = /(\+|-)?(\d*\.\d*)/;
                if (regex.test(val)){
                    return true;
                } else {
                    return false;
                }       
            } else {
                return true;
            }
        } else {
            return false;
        }
    });
</code></pre>

<p>but for some reason, the text field only allows one character... and not even a number</p>
