how to validate for money in jquery where max amount i can enter is 9999.99 so my requirements are: 1.it should allow only digits and one dot 2.max length is 7(including dot) 3.before dot max length is 4 4.after dot max length is 2
currently my textbox allows only digits and one dot with the following code
$('#txtpaymentamnt, #txttenderamt').on("keypress", function (e) {
alert(e.which);
if (e.which != 8 && e.which != 0 && ((e.which < 48 || e.which > 57) && e.which != 46)) {
e.preventDefault();
}