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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s