function checkDupUsername(str){ if (str.length==0) { return; } xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert (browser_support); return; } var url="/inc/checkusername.asp"; url += "?Username=" + str; url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChangedUsername; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function checkDupEmail(str){ if (str.length==0) { return; } xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert (browser_support); return; } var url="/inc/checkemail.asp"; url += "?email=" + str; url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChangedEmail; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChangedEmail(){ if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { var ErrorSpan = document.getElementById("DupEmail"); var ErrorSpan2 = document.getElementById("EmailError"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; response = xmlHttp.responseText; if (response != ""){ //ErrorSpan.innerHTML="*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML=response; ErrorSpan2.style.display = "block"; var txtemail = document.getElementById("Email"); txtemail.focus(); txtemail.select(); }else{ ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; } } } function stateChangedUsername(){ if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { var ErrorSpan = document.getElementById("DupUsername"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; response = xmlHttp.responseText; if (response != ""){ ErrorSpan.innerHTML="*"; ErrorSpan.style.display = ""; ErrorSpan.innerHTML=response; ErrorSpan.style.display = ""; var txtuser = document.getElementById("NewUserName"); txtuser.focus(); txtuser.select(); }else{ ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; } } } function validateUsername(){ var Username = document.getElementById("NewUserName"); var ErrorSpan = document.getElementById("DupUsername"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; checkDupUsername(Username.value); if (Username.value.length == 0) { if (typeof(choose_Username)=="undefined") choose_Username ="Enter a valid username."; choose_Username ="Enter a valid username."; //ErrorSpan2.innerHTML=choose_Username; //ErrorSpan2.style.display = "block"; ErrorSpan.innerHTML=choose_Username; ErrorSpan.style.display = ""; Username.focus(); Username.select(); return false; } return true; } function validatePassword(){ var Password = document.getElementById("NewPassword"); var ErrorSpan = document.getElementById("PasswordError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Password.value.length == 0) { if (typeof(choose_password)=="undefined") choose_password = "Please choose a password." ErrorSpan.innerHTML="*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML=choose_password; ErrorSpan2.style.display = "block"; Password.focus(); return false; } return true; } function validatePassword2(){ var Password = document.getElementById("NewPassword"); var ConfirmPassword = document.getElementById("ConfirmPassword"); var ErrorSpan = document.getElementById("PasswordError"); var ErrorSpan2 = document.getElementById("Password2Error"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Password.value.length == 0 || ConfirmPassword.value.length == 0 ) return false if (ConfirmPassword.value != Password.value) { if (typeof(pass_confirmation)=="undefined") pass_confirmation = "Your password does not match the confirmation, please re-type your password."; ErrorSpan.innerHTML="*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML=pass_confirmation; ErrorSpan2.style.display = "block"; Password.focus(); Password.select(); return false; } return true; } /*//////Register popup validation**/ function validateFirstName(){ var FirstName = document.getElementById("FirstName"); var ErrorSpan = document.getElementById("FirstNameError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (FirstName.value.length == 0) { if (typeof(Please_first_name)=="undefined") Please_first_name = ""; ErrorSpan.innerHTML = Please_first_name; ErrorSpan.style.display = ""; FirstName.focus(); FirstName.select(); //ErrorSpan2.innerHTML = Please_first_name; //ErrorSpan2.style.display = "block"; return false; } return true; } function validateFirstName2(){ var FirstName = document.getElementById("FirstName2"); var ErrorSpan = document.getElementById("FirstNameError2"); var ErrorSpan2 = document.getElementById("errorMessage2"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (FirstName.value.length == 0) { if (typeof(Please_first_name)=="undefined") Please_first_name = ""; ErrorSpan.innerHTML = Please_first_name; ErrorSpan.style.display = ""; FirstName.focus(); ErrorSpan2.innerHTML = ""; ErrorSpan2.style.display = "block"; return false; } return true; } function validateLastName(){ var LastName = document.getElementById("LastName"); var ErrorSpan = document.getElementById("LastNameError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (LastName.value.length == 0) { if (typeof(Please_last_name)=="undefined") Please_last_name = ""; ErrorSpan.innerHTML = Please_last_name; ErrorSpan.style.display = ""; LastName.focus(); LastName.select(); //ErrorSpan2.innerHTML = Please_last_name; //ErrorSpan2.style.display = "block"; return false; } return true; } function validateLastName2(){ var LastName = document.getElementById("LastName2"); var ErrorSpan = document.getElementById("LastNameError2"); var ErrorSpan2 = document.getElementById("errorMessage2"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (LastName.value.length == 0) { if (typeof(Please_last_name)=="undefined") Please_last_name = ""; ErrorSpan.innerHTML = Please_last_name; ErrorSpan.style.display = ""; LastName.focus(); ErrorSpan2.innerHTML = ""; ErrorSpan2.style.display = "block"; return false; } return true; } function validateEmail(){ var Email = document.getElementById("Email"); var ErrorSpan = document.getElementById("EmailError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Email.value.length == 0 || !(emailcheck(Email.value)) ) { if (typeof(Please_email)=="undefined") Please_email = "Please provide your email address, this will be the primary means of communication."; ErrorSpan.innerHTML = Please_email; ErrorSpan.style.display = ""; Email.focus(); Email.select(); //ErrorSpan2.innerHTML = Please_email; //ErrorSpan2.style.display = "block"; return false; } if (Email.value.length != 0) checkDupEmail(Email.value); if (typeof(ErrorSpan.value) != "undefined"){ if (ErrorSpan.value.length != 0){ return false; } } return true; } function validatePhone(){ var Phone = document.getElementById("Phone"); var ErrorSpan = document.getElementById("PhoneError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Phone.value.length == 0) { if (typeof(please_phone_number)=="undefined") please_phone_number = ""; ErrorSpan.innerHTML= please_phone_number; ErrorSpan.style.display = ""; Phone.focus(); Phone.select(); //ErrorSpan2.innerHTML= please_phone_number; //ErrorSpan2.style.display = "block"; return false; } return true; } function validatePhone2(){ var Phone = document.getElementById("Phone2"); var ErrorSpan = document.getElementById("PhoneError2"); var ErrorSpan2 = document.getElementById("errorMessage2"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Phone.value.length == 0) { if (typeof(please_phone_number)=="undefined") please_phone_number = ""; ErrorSpan.innerHTML= please_phone_number; ErrorSpan.style.display = ""; Phone.focus(); ErrorSpan2.innerHTML= ""; ErrorSpan2.style.display = "block"; return false; } return true; } function validateAddress(){ var Address1 = document.getElementById("Address"); var ErrorSpan = document.getElementById("AddressError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; if (Address1.value.length == 0) { if (typeof(Please_Street_Address)=="undefined") Please_Street_Address = ""; ErrorSpan.innerHTML = Please_Street_Address; ErrorSpan.style.display = ""; Address1.focus(); Address1.select(); //ErrorSpan2.innerHTML = Please_Street_Address; //ErrorSpan2.style.display = "block"; return false; } return true; } function validateAddress2(){ var Address1 = document.getElementById("Address2"); var ErrorSpan = document.getElementById("AddressError2"); var ErrorSpan2 = document.getElementById("errorMessage2"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Address1.value.length == 0) { if (typeof(Please_Street_Address)=="undefined") Please_Street_Address = ""; ErrorSpan.innerHTML = Please_Street_Address; ErrorSpan.style.display = ""; Address1.focus(); ErrorSpan2.innerHTML = ""; ErrorSpan2.style.display = "block"; return false; } return true; } function validateCity(){ var City = document.getElementById("City"); var ErrorSpan = document.getElementById("CityError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (City.value.length == 0) { if (typeof(Please_City)=="undefined") Please_City = ""; ErrorSpan.innerHTML= Please_City; ErrorSpan.style.display = ""; City.focus(); City.select(); //ErrorSpan2.innerHTML= Please_City; //ErrorSpan2.style.display = "block"; return false; } return true; } function validateCity2(){ var City = document.getElementById("City2"); var ErrorSpan = document.getElementById("CityError2"); var ErrorSpan2 = document.getElementById("errorMessage2"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (City.value.length == 0) { if (typeof(Please_City)=="undefined") Please_City = ""; ErrorSpan.innerHTML= Please_City; ErrorSpan.style.display = ""; City.focus(); ErrorSpan2.innerHTML= ""; ErrorSpan2.style.display = "block"; return false; } return true; } function validateZip(){ var Zip = document.getElementById("Zip"); var ErrorSpan = document.getElementById("ZipError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Zip.value.length == 0) { if (typeof(Please_Zip)=="undefined") Please_Zip = ""; ErrorSpan.innerHTML= Please_Zip; ErrorSpan.style.display = ""; Zip.focus(); Zip.select(); //ErrorSpan2.innerHTML= Please_Zip; //ErrorSpan2.style.display = "block"; return false; } return true; } function validateZip2(){ var Zip = document.getElementById("Zip2"); var ErrorSpan = document.getElementById("ZipError2"); var ErrorSpan2 = document.getElementById("errorMessage2"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Zip.value.length == 0) { if (typeof(Please_Zip)=="undefined") Please_Zip = ""; ErrorSpan.innerHTML= Please_Zip; ErrorSpan.style.display = ""; Zip.focus(); ErrorSpan2.innerHTML= ""; ErrorSpan2.style.display = "block"; return false; } return true; } function validateCountry(){ var Country = document.getElementById("countrySelect"); var ErrorSpan = document.getElementById("CountryError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (Country.selectedIndex == 0) { if (typeof(Please_Country)=="undefined") Please_Country = "Please select your Country."; ErrorSpan.innerHTML= "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML= Please_Country; ErrorSpan2.style.display = "block"; return false; } return true; } function validateState(){ var State = document.getElementById("stateSelect"); var ErrorSpan = document.getElementById("StateError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (State.selectedIndex == 0) { if (typeof(Please_State)=="undefined") Please_State = "Please select your State."; ErrorSpan.innerHTML= "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML= Please_State; ErrorSpan2.style.display = "block"; return false; } return true; } function validateStateInput(){ var State = document.getElementById("stateSelect"); var ErrorSpan = document.getElementById("StateError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; if (State.value.length == 0) { if (typeof(Please_State)=="undefined") Please_State = "Please select your State."; ErrorSpan.innerHTML= "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML= Please_State; ErrorSpan2.style.display = "block"; return false; } } function validateRegistrationForm(){ debug = false; //username special characters if (document.getElementById("NewUserName").value.length > 0) { if (!usernameInvalidCharacter1()){ return false; } } // Password if (!validateUsername()) return false; if (!validatePassword()) return false; if (debug) alert ("Password"); if (!validatePassword2()) return false; if (debug) alert ("Password2"); // Email if (!validateEmail()){ return false; } if (debug) alert ("Email"); if (debug) return false; return true; } function usernameInvalidCharacter1(){ vusername = document.getElementById("NewUserName").value; var ar = ["!","@","#","$","%","^","&","*","(",")","-","'"]; for (var i = 0; i < ar.length; i++) { if (vusername.indexOf(ar[i])>-1){ document.getElementById("DupUsername").innerHTML="Please enter letters and numbers only for your Username"; document.getElementById("DupUsername").style.display = "block"; //document.getElementById("NewUserName").focus(); return false; } } return true; } function freeMoneyValidateRegistrationForm(){ debug = false; //username special characters if (document.getElementById("NewUserName").value.length > 0) { if (!usernameInvalidCharacter1()) return false; } // Password if(!validateUsername()){ return false; } if (!validatePassword()) return false; if (!validatePassword2()) return false; // Email if (!validateFirstName()) return false; if (!validateLastName()) return false; if (!validateBirthDate()) return false; if (!validateEmail()) return false; if (!validatePhone()) return false; if (!validateAddress()) return false; if (!validateCity()) return false; if (!validateZip()) return false; if (debug) return false; return true; } function freeMoneyCompleteInfoValidateRegistrationForm(){ debug = false; if (!validateFirstName2()) return false; if (!validateFirstName2()) return false; if (!validateLastName2()) return false; if (!validatePhone2()) return false; if (!validateBirthDate2()) return false; if (!validateAddress2()) return false; if (!validateCity2()) return false; if (!validateZip2()) return false; if (debug) return false; return true; } function validateRoomUsername(){ var RoomUsername = document.getElementById("RoomUsername"); var ErrorSpan = document.getElementById("RoomUsernameError"); var NoErrors = true; ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; if (RoomUsername.value.length == 0) { if (typeof(Please_user_x_reg)=="undefined") Please_user_x_reg = "Please enter the Username you used to sign up."; ErrorSpan.innerHTML= Please_user_x_reg; ErrorSpan.style.display = "block"; NoErrors = false; } //Check for spaces on username if (RoomUsername.value.indexOf(' ') >= 0) { ErrorSpan.innerHTML= "Username cannot contain spaces"; ErrorSpan.style.display = "block"; NoErrors = false; } return NoErrors; } function validateRoomUsername2(){ var RoomUsername = document.getElementById("RoomUsername2"); var ErrorSpan = document.getElementById("RoomUsername2Error"); ErrorSpan.style.display = "none"; if (RoomUsername.value.length == 0) { ErrorSpan.style.display = "block"; return false; } return true; } function validateAccountDate(){ var AccountDate = document.getElementById("AccountDate"); var ErrorSpan = document.getElementById("DateError"); /* var DateVal = AccountDate.value; if (DateVal.length == 0){ ErrorSpan.innerHTML = "Please enter a date"; return false; } if (!IsValidDate(DateVal)){ ErrorSpan.innerHTML = "Invalid Date"; return false; } */ var aMonth = document.getElementById("aMonth"); var aDay = document.getElementById("aDay"); var aYear = document.getElementById("aYear"); var dateToValidate = ""; var retValue = true; ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; // Check Month if (aMonth.value.length == 0) { if (typeof(select_a_month)=="undefined") select_a_month = ""; ErrorSpan.innerHTML = select_a_month; ErrorSpan.style.display = "block"; aMonth.focus(); retValue = false; } // Check Day if (aDay.value.length == 0) { if (typeof(select_a_day)=="undefined") select_a_day = ""; ErrorSpan.innerHTML = select_a_day; ErrorSpan.style.display = "block"; aDay.focus(); retValue = false; } // Check Year if (aYear.value.length == 0) { if (typeof(select_a_year)=="undefined") select_a_year = ""; ErrorSpan.innerHTML = select_a_year; ErrorSpan.style.display = "block"; aYear.focus(); retValue = false; } dateToValidate = aDay.value + "/" + aMonth.value + "/" + aYear.value if(isValidDate(dateToValidate) === true && retValue === true){ AccountDate.value = aYear.value + "/" + aMonth.value + "/" + aDay.value retValue = true; } else { ErrorSpan.innerHTML = "Invalid Date"; ErrorSpan.style.display = "block"; aYear.focus(); retValue = false; } return retValue; } function validateBirthDate(){ var BirthDate = document.getElementById("BirthDate"); var ErrorSpan = document.getElementById("BirthDateError"); var ErrorSpan2 = document.getElementById("errorMessage"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; var bMonth = document.getElementById("bMonth"); var bDay = document.getElementById("bDay"); var bYear = document.getElementById("bYear"); // Check Month if (bMonth.value.length == 0) { if (typeof(select_your_birth_month)=="undefined") select_your_birth_month = ""; ErrorSpan.innerHTML = "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML = select_your_birth_month; ErrorSpan2.style.display = "block"; bMonth.focus(); return false; } // Check Day if (bDay.value.length == 0) { if (typeof(select_your_birth_Day)=="undefined") select_your_birth_Day = ""; ErrorSpan.innerHTML = "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML = select_your_birth_Day; ErrorSpan2.style.display = "block"; bDay.focus(); return false; } // Check Year if (bYear.value.length == 0) { if (typeof(select_your_birth_Year)=="undefined") select_your_birth_Year = ""; ErrorSpan.innerHTML = "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML = select_your_birth_Year; ErrorSpan2.style.display = "block"; bYear.focus(); return false; } BirthDate.value = bMonth.value + "/" + bDay.value + "/" + bYear.value return true; } function validateBirthDate2(){ var BirthDate = document.getElementById("BirthDate2"); var ErrorSpan = document.getElementById("BirthDateError2"); var ErrorSpan2 = document.getElementById("errorMessage2"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; ErrorSpan2.innerHTML=""; ErrorSpan2.style.display = "none"; var bMonth = document.getElementById("bMonth2"); var bDay = document.getElementById("bDay2"); var bYear = document.getElementById("bYear2"); // Check Month if (bMonth.value.length == 0) { if (typeof(select_your_birth_month)=="undefined") select_your_birth_month = ""; ErrorSpan.innerHTML = "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML = select_your_birth_month; ErrorSpan2.style.display = "block"; bMonth.focus(); return false; } // Check Day if (bDay.value.length == 0) { if (typeof(select_your_birth_Day)=="undefined") select_your_birth_Day = ""; ErrorSpan.innerHTML = "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML = select_your_birth_Day; ErrorSpan2.style.display = "block"; bDay.focus(); return false; } // Check Year if (bYear.value.length == 0) { if (typeof(select_your_birth_Year)=="undefined") select_your_birth_Year = ""; ErrorSpan.innerHTML = "*"; ErrorSpan.style.display = ""; ErrorSpan2.innerHTML = select_your_birth_Year; ErrorSpan2.style.display = "block"; bYear.focus(); return false; } BirthDate.value = bMonth.value + "/" + bDay.value + "/" + bYear.value return true; } function isValidDate(s) { var bits = s.split('/'); var d = new Date(bits[2], bits[1] - 1, bits[0]); return d && (d.getMonth() + 1) == bits[1]; } function validateAmount(){ var ErrorSpan = document.getElementById("AmountError"); var AmountField = document.getElementById("Amount"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; if (AmountField.value.length == 0){ ErrorSpan.innerHTML = ""; ErrorSpan.style.display = "block"; return false; } if (isNaN(AmountField.value)){ ErrorSpan.innerHTML = ""; ErrorSpan.style.display = "block"; return false; } if (AmountField.value < 0){ if (typeof(Please_enter_amount)=="undefined") Please_enter_amount = ""; ErrorSpan.innerHTML = Please_enter_amount; ErrorSpan.style.display = "block"; return false; } return true; } function IsValidDate(DateVal){ splitDate= DateVal.split("/"); if (splitDate.length != 3){ return false; } Mn = splitDate[0]; Day = splitDate[1]; Yr = splitDate[2]; var dt = new Date(DateVal); if(dt.getDate()!=Day){ return false; } else if(dt.getMonth()!=Mn-1){ //this is for the purpose JavaScript starts the month from 0 return false; } else if(dt.getYear()!=Yr){ return false; } return true; } function validateAmount(){ var ErrorSpan = document.getElementById("AmountError"); var AmountField = document.getElementById("Amount"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; if (AmountField.value.length == 0){ ErrorSpan.innerHTML = ""; ErrorSpan.style.display = "block"; return false; } if (isNaN(AmountField.value)){ ErrorSpan.innerHTML = ""; ErrorSpan.style.display = "block"; return false; } if (AmountField.value < 0){ if (typeof(Please_enter_amount)=="undefined") Please_enter_amount = ""; ErrorSpan.innerHTML = Please_enter_amount; ErrorSpan.style.display = "block"; return false; } return true; } function emailcheck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false } if (str.indexOf(at,(lat+1))!=-1){ return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false } if (str.indexOf(dot,(lat+2))==-1){ return false } if (str.indexOf(" ")!=-1){ return false } return true } function validateField(field, errorMessageObjId, errorMessage){ var ErrorSpan = document.getElementById("errorMessageObjId"); ErrorSpan.innerHTML=""; ErrorSpan.style.display = "none"; if (field.value.length == 0) { ErrorSpan.innerHTML = errorMessage; ErrorSpan.style.display = "block"; return false; } return true; }