Try this: function superCoolValidator(value, element, params) { if(isNaN(parseInt(value.replace(/[\$\.,]/, ""))) { return false; } else { return true; } }
$.validator.addMethod("superCoolValidator", superCoolValidator, "Your input is not super cool!"); [1] [1] http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatoraddMethodStringFunctionString On 4/9/07, Rick Faircloth <[EMAIL PROTECTED]> wrote:
Hi, all... I want to create custom validation that would test input the same as this ColdFusion function, <CFIF Not IsNumeric(REReplace(Form.Principal, "[$.,]", "", "All"))> which states that "if after all dollar signs, commas, and periods are stripped from the input value, the value is not numeric..." How would I write that in Javascript so I can use it as a custom validation in Jorn's Validation plug-in? Realize that I don't want to change the value, I just want to run it through a test... CF-coders? Thanks, Rick
-- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com