I need to write the function to check whether the input value is in currency or not. I know that I can use the regular expression in the JavaScript function.
you can validate the input string as decimal up to two numbers like:
function j_is_Currency(s)
{
var pat = /^[$]?\d{1,10}([.]\d{2})?$/;
if (s.length > 0)
{
var matchArr = s.match(pat);
if(matchArr==null)
return false;
}
return true;
}