Salary Column Validation

$(‘input[title=”SalaryAdvance”]’).keypress(function(e) {
var $regex = /^[0-9-]*$/;
var $str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
if ($regex.test($str))
{
return true;
}
else
{
e.preventDefault();
alert(‘Please enter numbers only!’);
return false;
}
});
// Using Key Press Function Validating the Currency field Using JQuery

if( $(‘input[title=”SalaryAdvance”]’).val()== undefined || $(‘input[title=”SalaryAdvance”]’).val()== “”)
{
alert(“Please Enter Salary Advance”);
$(‘input[title=”SalaryAdvance”]’).focus();
return false;
}
// To Give a focus out function to the column SalaryAdvance

Advertisements