function ValidateCharacter(strValidChars, evt) //Function does not allow to enter character on keypress
{
var strChar = "";
var charCode = (evt.which) ? evt.which : event.keyCode
var strString = String.fromCharCode(charCode);
strChar = strString.charAt(0);
var strValidChars2 = getEnglishNumbersValue(strValidChars);
if (strValidChars2.indexOf(strChar) == -1) {
if ((charCode == 8)) {
return true;
}
else
{
return false;
}
}
else {
return true;
}
}
function CurrentDate(CtrlName) {
var dt = new Date();
var dtstring = pad(dt.getDate(), 2) + '-' + pad(dt.getMonth() + 1, 2) + '-' + dt.getFullYear();
document.getElementById(CtrlName).value = dtstring;
}
function isDate(dateStr) {
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
var matchArray = dateStr.match(datePat); // is the format ok?
if (matchArray == null) {
DisplayAlertMessageBox("Please enter date as either dd/mm/yyyy or dd-mm-yyyy.");
return false;
}
day = matchArray[1]; // p@rse date into variables
month = matchArray[3];
year = matchArray[5];
if (month < 1 || month > 12) { // check month range
DisplayAlertMessageBox("Month must be between 1 and 12.");
return false;
}
if (day < 1 || day > 31) {
DisplayAlertMessageBox("Day must be between 1 and 31.");
return false;
}
if ((month == 4 || month == 6 || month == 9 || month == 11) && day == 31) {
DisplayAlertMessageBox("Month " + month + " doesn`t have 31 days!")
return false;
}
if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day == 29 && !isleap)) {
DisplayAlertMessageBox("February " + year + " doesn`t have " + day + " days!");
return false;
}
}
return true; // date is valid
}
function IsNumeric(strString, Message, EmptyAllowed, NegativeAllowed, DecimalAllowed, MaxNoAllowed) {
var strValidChars = "0123456789";
var strChar;
var blnResult = true;
var NoOfNegativeSigns = 0; var NoOfDecimalsieDots = 0;
if (NegativeAllowed == true)
strValidChars = strValidChars + '-';
if (DecimalAllowed > 0)
strValidChars = strValidChars + '.';
if (EmptyAllowed == true) {
if (strString.length == 0) return true;
if (Trim(strString).length == 0) return true;
}
else {
if (strString.length == 0) {
DisplayAlertMessageBox(Message + ' should not be empty');
return false;
}
}
// Checking Weather All Characters are numeric are not
for (i = 0; i < strString.length && blnResult == true; i++) {
strChar = strString.charAt(i);
if (strValidChars.indexOf(strChar) == -1) {
DisplayAlertMessageBox('Invalid characters in ' + Message);
return false;
}
}
if (NegativeAllowed == true) {
// Check For -ve Sign Exists Only Once If Exists
for (i = 0; i < strString.length && blnResult == true; i++) {
strChar = strString.charAt(i);
if (strString.charAt(i) == '-') {
NoOfNegativeSigns++;
}
}
if (NoOfNegativeSigns > 1) {
DisplayAlertMessageBox('Invalid Number.');
return false;
}
else if (NoOfNegativeSigns == 1) {
if (strString.indexOf('-') > 0) {
DisplayAlertMessageBox('Invalid Number');
return false;
}
}
}
if (DecimalAllowed > 0) {
// Check For Decimal Value Exists Only Once If Exists
for (i = 0; i < strString.length && blnResult == true; i++) {
strChar = strString.charAt(i);
if (strString.charAt(i) == '.') {
NoOfDecimalsieDots++;
}
}
if (NoOfDecimalsieDots > 1) {
DisplayAlertMessageBox('Invalid Number');
return false;
}
else if (NoOfDecimalsieDots == 1) {
if (strString.substring(strString.indexOf('.') + 1, strString.length).length > DecimalAllowed) {
DisplayAlertMessageBox(Message + ' should be only ' + DecimalAllowed + ' Decimal Places.');
return false;
}
}
}
if (strString > MaxNoAllowed) {
DisplayAlertMessageBox(Message + ' should not be more than ' + MaxNoAllowed + '.');
return false;
}
return true;
}
function validateEmail(srcControlValue,msgEmail) {
//debugger;
var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (filter.test(srcControlValue)) {
$(msgEmail).text('');
$(msgEmail).removeClass('field-validation-error');
/// return true;
}
else {
$(msgEmail).text('Please enter a valid email address');
$(msgEmail).removeClass().addClass('field-validation-error')
///return false;
}
}
function ValidateMobileNo(CtrlName,msgMobileNo) {
//debugger;
var MobileNo = document.getElementById(CtrlName).value;
if (MobileNo != "") {
//debugger;
var incomingString = MobileNo;
if ((incomingString).length > 10 || incomingString.search(/[^0-9\-()+]/g) != -1) {
$(msgMobileNo).text('Please enter valid mobile number');
$(msgMobileNo).removeClass().addClass('field-validation-error');
// document.getElementById(CtrlName).focus();
//return false;
}
}
else {
$(msgMobileNo).text('Please enter valid mobile number');
$(msgMobileNo).removeClass().addClass('field-validation-error')
//document.getElementById(CtrlName).focus();
//return false;
}
}
//function Validate() {
// var mobile = document.getElementById("mobile").value;
// var pattern = /^\d{10}$/;
// if (pattern.test(mobile)) {
// alert("Your mobile number : " + mobile);
// return true;
// }
// alert("It is not valid mobile number.input 10 digits number!");
// return false;
//}
function CheckPassword(inputtxt, msgpassword) {
//debugger;
var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
if (inputtxt.val().match(decimal)) {
return true;
}
else {
return false;
}
}
function OnlyAlphabetic(evt) {
var charCode;
//debugger;
var e = evt || event; // for trans-browser compatibility
charCode = (e.which) ? e.which : event.keyCode;
if (charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90 || charCode >= 48 && charCode <= 57 || charCode == 8 || charCode == 32 || charCode==13) {
$('#divMessage').css('display', 'none');
$("#lblMessage").text("");
return true;
}
else {
$('#divMessage').css('display', '');
$("#lblMessage").text("Only alphabets,Number and space allowed");
// alert("Only alphabets,Number and space allowed");
return false;
}
}
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
var pincode = document.getElementById('PinCode');
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57)) {
$('#divMessage').css('display', '');
$("#lblMessage").text("Only Numbers are allowed!!!");
return false;
}
else {
$('#divMessage').css('display', 'none');
$("#lblMessage").text("");
if (pincode.value.length < 6) {
return true;
}
else {
return false;
}
return true;
}
}
//---added on 7th july15---
function validEmailID(val) {
var txt = val;
if (txt.match(/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/)) {
return true;
}
else {
return false;
}
}
function onlyNumbers(evt) {
flag = false
var e = evt; // for trans-browser compatibility
var charCode = e.which || e.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
//alert("Only numbers are allowed");
return false;
}
return true;
}
bonus buy games egypt s sun
calcio live streaming
best betting apps
tennis betting
calcio live updates 2025
divine gongs
slot medusa s stone
slot dolphin riches hold and win
slot safari dance
live casino hotel near popular attractions
finnegan s banditos
boom boom gold
triple christmas gold
midnight marauder
bonus buy games golden catch
bonus buy games diamond bounty 7s hold and win
cleopatra s gems rockways
slot cash strike
cleocatra game
pirates pearl megaways
bonus buy games dragon wonder
horse racing betting odds
bonus buy games fates fury
bonus buy games barbarian
glory casino live baccarat strategy
OK sport