I am currently taking input in a text-box and on-submit, I am validating the input, the input needs to be a number greater than 0, it should be integer and not contain decimal point. The problem is I am not able to find any method by which we can detect it is integer or contains decimal point. Here is the code I am using.
txt[5] = $(this).parents('p').find('input:text').val();
if (txt[5] == "" || isNaN(txt[5]) || txt[5] <= 0)
{
alert("Incorrect Quantity");
return false;
}
Basically as you see I am validating the input given by user, I want to show them a message if the input is wrong, so I am currently using txt[5]%1!=0 to make sure only INT is allowed, but I am open to new answers.