Код: Выделить всё
if($('.calculator #loan_Amount').val() != "") {
var value = $('.calculator #loan_Amount').val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
var intRegex = /^\d+$/;
if(!intRegex.test(value)) {
alert('Loan amount must be numeric.');
return false;
}
}
Подробнее здесь: https://stackoverflow.com/questions/201 ... nput-field
Мобильная версия