i have a form in which user input the price and im unable to validate the price here is the code below
<input placeholder="e.g 22,000" type="text" id="salary" name="salary">
jQuery("#salary").validate({
expression: "if (VAL.match(/^[0-9,]{3,10}$/)) return true; else return
false;",
message: "Please enter Correct Salary"
});
Now whenever a user enter 15000 it should automatically put comma like this "15,000" and if he enters in lakh then like this 1,50,000
It's better to use HTML5 input elements with their patterns (you can import libs for older browsers), also plz check this link: HTML 5 Currency format