I have two text box in a form. One verifies for number only and another one for number and comma.
1st case number only.
function(textBoxObject) {
var that = $(this),
val = that.val();
if (val === "" || isNaN(val)) {
that.addClass("error");
} else {
that.removeClass("error");
}
}
2nd case number and comma.
How do I handle another textbox which takes numbers and commas? And is it possible to add the logic in the first function itself?