javaScript

function RegisterValidation() {

var valid = true;
var mob = /^[1-9]{1}[0-9]{9}$/;
var ZipCode = /^[1-9]{1}[0-9]$/;
var txtName = $(“#txt_Name”).val();
var txtEmail = $(“#txt_Email”).val();
var txtPassword = $(“#txt_Password”).val();
var txtConfPassword = $(“#txt_ConfirmPassword”).val();
var txtPhone = $(“#txt_Phone”).val();
var txtMobile = $(“#txt_Mobile”).val();
var txtRegistrationCity = $(“#txt_RegistrationCity”).val();
var txtRegistrationCountry = $(“#txt_RegistrationCountry”).val();
var txtRegistrationState = $(“#txt_RegistrationState”).val();
var txtZipCode = $(“#txt_ZipCode”).val();

if ((txtName) == “”
&& (txtEmail) == “”
&& (txtPassword) == “”
&& (txtConfPassword) == “”
&& (txtPhone) == “”
&& (txtMobile) == “”
&& (txtRegistrationCity) == “”
&& (txtRegistrationCountry) == “”
&& (txtRegistrationState) == “”
&& (txtZipCode) == “”) {
$(‘#txt_Name’).css(‘border-color’, ‘red’);
$(‘#txt_Email’).css(‘border-color’, ‘red’);
$(‘#txt_Password’).css(‘border-color’, ‘red’);
$(‘#txt_ConfirmPassword’).css(‘border-color’, ‘red’);
$(‘#txt_Phone’).css(‘border-color’, ‘red’);
$(‘#txt_Mobile’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationCity’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationCountry’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationState’).css(‘border-color’, ‘red’);
$(‘#txt_ZipCode’).css(‘border-color’, ‘red’);
valid = false;
$(“#txt_Name”).focus();
}
else if ($(‘#txt_Name’).val() == ”) {
$(‘#txt_Name’).css(‘border-color’, ‘red’);
$(“#txt_Name”).focus();
valid = false;
}
else if ($(‘#txt_Email’).val() == ”) {
$(‘#txt_Email’).css(‘border-color’, ‘red’);
$(“#txt_Email”).focus();
valid = false;
}
else if (!ValidateEmail($(‘#txt_Email’).val())) {
alert(‘Please Enter a valid Email id ‘);
$(‘#txt_Email’).css(‘border-color’, ‘red’);
$(“#txt_Email”).focus();
valid = false;
}
else if ($(‘#txt_Password’).val() == ”) {
$(‘#txt_Password’).css(‘border-color’, ‘red’);
$(“#txt_Password”).focus();
valid = false;
}
else if (!isValidPassword($(‘#txt_Password’).val())) {
alert(‘ Password Contains At least one Capital letter ,one Small letter, one numeric number,one Special Character And Minimum 8 and Maximum 16 ‘);
$(‘#txt_Password’).css(‘border-color’, ‘red’);
$(“#txt_Password”).focus();
valid = false;
}

else if ($(‘#txt_ConfirmPassword’).val() == ”) {
$(‘#txt_ConfirmPassword’).css(‘border-color’, ‘red’);
$(“#txt_ConfirmPassword”).focus();
valid = false;
}
else if (!(txtPassword == txtConfPassword)) {
alert(‘ Password Does not Match ‘);
$(‘#txt_Password’).css(‘border-color’, ‘red’);
$(“#txt_Password”).focus();
valid = false;
}
else if ($(‘#txt_Phone’).val() == ”) {
$(‘#txt_Phone’).css(‘border-color’, ‘red’);
$(“#txt_Phone”).focus();
valid = false;
}
else if (!mob.test($(‘#txt_Phone’).val())) {
alert(‘Please Enter Valid phone no’);
$(‘#txt_Phone’).css(‘border-color’, ‘red’);
$(“#txt_Phone”).focus();
valid = false;
}

else if ($(‘#txt_Mobile’).val() == ”) {
$(‘#txt_Mobile’).css(‘border-color’, ‘red’);
$(“#txt_Mobile”).focus();
valid = false;
}
else if (!mob.test($(‘#txt_Mobile’).val())) {
alert(‘Please Enter Valid Mobile no’);
$(‘#txt_Mobile’).css(‘border-color’, ‘red’);
$(“#txt_Mobile”).focus();
valid = false;
}

else if ($(‘#txt_RegistrationCity’).val() == ”) {
$(‘#txt_RegistrationCity’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationCity”).focus();
valid = false;
}

else if ($(‘#txt_RegistrationCountry’).val() == ”) {
$(‘#txt_RegistrationCountry’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationCountry”).focus();
valid = false;
}

else if ($(‘#txt_RegistrationState’).val() == ”) {
$(‘#txt_RegistrationState’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationState”).focus();
valid = false;
}

else if ($(‘#txt_ZipCode’).val() == ”) {
$(‘#txt_ZipCode’).css(‘border-color’, ‘red’);
$(“#txt_ZipCode”).focus();
valid = false;
}

else if (valid) {
debugger;
//var aa = window.location.host;
var Email = $(“#txt_Email”).val();
//var url = “/LegalDocument/CheckEmailExist/”;
//var url = ‘http://’ + window.location.host + ‘/LegalDocument/CheckEmailExist’;
$(“#btnUserRegistration”).val(‘Plesae wait..’);
$(“#btnUserRegistration”).attr(“style”, “background:Gray”)
$(“#btnUserRegistration”).attr(“disabled”, true);
$.ajax({
url: ‘http://’ + window.location.host + ‘/LegalDocument/CheckEmailExist’,
data: { userId: Email },
cache: false,
type: “POST”,
success: function (data) {
debugger;
if (data == “userE”) {
alert(“user registration successfully”);
$(‘#SubmitData’).submit();

} else {
alert(“This Email id Already Exist in DataBase.”);
$(“#btnUserRegistration”).val(‘SIGNUP’);
$(“#btnUserRegistration”).attr(“style”, “background:rgba(0, 0, 0, 0) linear-gradient(to bottom, rgba(43, 59, 146, 1) 0%, rgba(24, 38, 117, 1) 100%) repeat scroll 0 0”)
$(“#btnUserRegistration”).attr(“disabled”, false);
return false;
}
$(“#txt_Email”).attr({ ‘value’: ” });

},
error: function (reponse) {
alert(“error : ” + reponse);
}
});

}

}

function UserEditValidation() {

var valid = true;
var mob = /^[1-9]{1}[0-9]{9}$/;
var ZipCode = /^[1-9]{1}[0-9]$/;
var txtName = $(“#txt_Name”).val();
var txtEmail = $(“#txt_Email”).val();
var txtAddress = $(“#txt_EditAddress”).val();
var txtRegistrationCity = $(“#txt_RegistrationCity”).val();
var txtRegistrationCountry = $(“#txt_RegistrationCountry”).val();
var txtRegistrationState = $(“#txt_RegistrationState”).val();
var txtZipCode = $(“#txt_ZipCode”).val();
var txtOldPassword = $(“#txt_OldPassword”).val();
var txtPassword = $(“#txt_Password”).val();
var txtConfPassword = $(“#txt_ConfirmPassword”).val();

if ((txtName) == “”
&& (txtEmail) == “”
&& (txtAddress) == “”
&& (txtRegistrationCity) == “”
&& (txtRegistrationCountry) == “”
&& (txtRegistrationState) == “”
&& (txtZipCode) == “”
) {
$(‘#txt_Name’).css(‘border-color’, ‘red’);
$(‘#txt_Email’).css(‘border-color’, ‘red’);
$(‘#txt_EditAddress’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationCity’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationCountry’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationState’).css(‘border-color’, ‘red’);
$(‘#txt_ZipCode’).css(‘border-color’, ‘red’);

valid = false;
$(“#txt_Name”).focus();
}
else if ($(‘#txt_Name’).val() == ”) {
$(‘#txt_Name’).css(‘border-color’, ‘red’);
$(“#txt_Name”).focus();
valid = false;
}
else if ($(‘#txt_Email’).val() == ”) {
$(‘#txt_Email’).css(‘border-color’, ‘red’);
$(“#txt_Email”).focus();
valid = false;
}
else if (!ValidateEmail($(‘#txt_Email’).val())) {
alert(‘Please Enter a valid Email id ‘);
$(‘#txt_Email’).css(‘border-color’, ‘red’);
$(“#txt_Email”).focus();
valid = false;
}

else if ($(‘#txt_EditAddress’).val() == ”) {
$(‘#txt_EditAddress’).css(‘border-color’, ‘red’);
$(“#txt_EditAddress”).focus();
valid = false;
}
else if ($(‘#txt_RegistrationCity’).val() == ”) {
$(‘#txt_RegistrationCity’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationCity”).focus();
valid = false;
}

else if ($(‘#txt_RegistrationCountry’).val() == ”) {
$(‘#txt_RegistrationCountry’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationCountry”).focus();
valid = false;
}

else if ($(‘#txt_RegistrationState’).val() == ”) {
$(‘#txt_RegistrationState’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationState”).focus();
valid = false;
}

else if ($(‘#txt_ZipCode’).val() == ”) {
$(‘#txt_ZipCode’).css(‘border-color’, ‘red’);
$(“#txt_ZipCode”).focus();
valid = false;
}

else if ($(‘#txt_OldPassword’).val() != ” || ($(‘#txt_Password’).val() != ”)) {
if ($(‘#txt_Password’).val() == ”) {
$(‘#txt_Password’).css(‘border-color’, ‘red’);
$(“#txt_Password”).focus();
valid = false;
}
else if ($(‘#txt_ConfirmPassword’).val() == ”) {
$(‘#txt_ConfirmPassword’).css(‘border-color’, ‘red’);
$(“#txt_ConfirmPassword”).focus();
valid = false;
}
else if (!isValidPassword($(‘#txt_Password’).val())) {
alert(‘ Password Contains At least one Capital letter ,one Small letter, one numeric number,one Special Character And Minimum 8 and Maximum 16 ‘);
$(‘#txt_Password’).css(‘border-color’, ‘red’);
$(“#txt_Password”).focus();
valid = false;
}
else if (!(txtPassword == txtConfPassword)) {
alert(‘ Password Does not Match ‘);
$(‘#txt_Password’).css(‘border-color’, ‘red’);
$(“#txt_Password”).focus();
valid = false;
}
else if (valid) {
debugger;
var Password = $(“#txt_OldPassword”).val();
//var url = “/LegalDocument/CheckPasswordExist/”;
//var url = ‘http://’ + window.location.host + ‘/LegalDocument/CheckPasswordExist’;
// var url = ‘(@System.Configuration.ConfigurationManager.AppSettings[“PageURL”])LegalDocument/CheckPasswordExist’;
$(“#btnUserEdit”).val(‘Plesae wait..’);
$(“#btnUserEdit”).attr(“style”, “background:Gray”)
$(“#btnUserEdit”).attr(“disabled”, true);
$.ajax({
url: ‘http://’ + window.location.host + ‘/LegalDocument/CheckPasswordExist’,
data: { pass: Password },
cache: false,
type: “POST”,
success: function (data) {

if (data == “userE”) {
alert(“This old Password not Exist in DataBase.”);
$(“#btnUserEdit”).val();
return false;
} else {
alert(“user Information Update successfully”);
$(‘#SubmitUserData’).submit(‘UPDATE’);
$(“#SubmitUserData”).attr(“style”, “background:rgba(0, 0, 0, 0) linear-gradient(to bottom, rgba(43, 59, 146, 1) 0%, rgba(24, 38, 117, 1) 100%) repeat scroll 0 0”)
$(“#SubmitUserData”).attr(“disabled”, false);
}
$(“#txt_OldPassword”).attr({ ‘value’: ” });

},
error: function (reponse) {
alert(“error : ” + reponse);
}
});
}

}

else {

alert(“user Information Update successfully”);
$(‘#SubmitUserData’).submit();
}
}

function verifydocumentValidation() {

var valid = true;
var txtCaseno = $(“#txtCaseno”).val();
var txtCourt = $(“#txtCourt”).val();
var txtFirstName = $(“#txtFirstName”).val();
var txtLastName = $(“#txtLastName”).val();
var txtAddress = $(“#txtAddress”).val();
var txtRegistrationCity = $(“#txtRegistrationCity”).val();
var txtRegistrationState = $(“#txt_RegistrationState”).val();
var txtZipCode = $(“#txtZipCode”).val();
var txtRegistrationCountry = $(“#txt_RegistrationCountry”).val();
var txtDateofArrest = $(“#txtDateofArrest”).val();
var txtOffense = $(“#txtOffense”).val();
var txtLengthofSupervison = $(“#txtLengthofSupervison”).val();
var txtSupEndDate = $(“#txtSupEndDate”).val();

if ((txtCaseno) == “”
&& (txtCourt) == “”
&& (txtFirstName) == “”
&& (txtLastName) == “”
&& (txtAddress) == “”
&& (txtRegistrationCity) == “”
&& (txtRegistrationState) == “”
&& (txtZipCode) == “”
&& (txtRegistrationCountry) == “”
&& (txtDateofArrest) == “”
&& (txtOffense) == “”
&& (txtLengthofSupervison) == “”
&& (txtSupEndDate) == “”
) {
$(‘#txtCaseno’).css(‘border-color’, ‘red’);
$(‘#txtCourt’).css(‘border-color’, ‘red’);
$(‘#txtFirstName’).css(‘border-color’, ‘red’);
$(‘#txtLastName’).css(‘border-color’, ‘red’);
$(‘#txtAddress’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationCity’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationState’).css(‘border-color’, ‘red’);
$(‘#txt_ZipCode’).css(‘border-color’, ‘red’);
$(‘#txt_RegistrationCountry’).css(‘border-color’, ‘red’);
$(‘#txtDateofArrest’).css(‘border-color’, ‘red’);
$(‘#txtOffense’).css(‘border-color’, ‘red’);
$(‘#txtLengthofSupervison’).css(‘border-color’, ‘red’);
$(‘#txtSupEndDate’).css(‘border-color’, ‘red’);

valid = false;
$(“#txtCaseno”).focus();
}

else if ($(‘#txtCaseno’).val() == ”) {
$(‘#txtCaseno’).css(‘border-color’, ‘red’);
$(“#txtCaseno”).focus();
valid = false;
}
else if ($(‘#txtCourt’).val() == ”) {
$(‘#txtCourt’).css(‘border-color’, ‘red’);
$(“#txtCourt”).focus();
valid = false;
}

else if ($(‘#txtFirstName’).val() == ”) {
$(‘#txtFirstName’).css(‘border-color’, ‘red’);
$(“#txtFirstName”).focus();
valid = false;
}

else if ($(‘#txtLastName’).val() == ”) {
$(‘#txtLastName’).css(‘border-color’, ‘red’);
$(“#txtLastName”).focus();
valid = false;
}

else if ($(‘#txtAddress’).val() == ”) {
$(‘#txtAddress’).css(‘border-color’, ‘red’);
$(“#txtAddress”).focus();
valid = false;
}

else if ($(‘#txt_RegistrationCity’).val() == ”) {
$(‘#txt_RegistrationCity’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationCity”).focus();
valid = false;
}
else if ($(‘#txt_RegistrationState’).val() == ”) {
$(‘#txt_RegistrationState’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationState”).focus();
valid = false;
}
else if ($(‘#txt_ZipCode’).val() == ”) {
$(‘#txt_ZipCode’).css(‘border-color’, ‘red’);
$(“#txt_ZipCode”).focus();
valid = false;
}

else if ($(‘#txt_RegistrationCountry’).val() == ”) {
$(‘#txt_RegistrationCountry’).css(‘border-color’, ‘red’);
$(“#txt_RegistrationCountry”).focus();
valid = false;
}
else if ($(‘#txtDateofArrest’).val() == ”) {
$(‘#txtDateofArrest’).css(‘border-color’, ‘red’);
$(“#txtDateofArrest”).focus();
valid = false;
}
else if ($(‘#txtOffense’).val() == ”) {
$(‘#txtOffense’).css(‘border-color’, ‘red’);
$(“#txtOffense”).focus();
valid = false;
}
else if ($(‘#txtLengthofSupervison’).val() == ”) {
$(‘#txtLengthofSupervison’).css(‘border-color’, ‘red’);
$(“#txtLengthofSupervison”).focus();
valid = false;
}
else if ($(‘#txtSupEndDate’).val() == ”) {
$(‘#txtSupEndDate’).css(‘border-color’, ‘red’);
$(“#txtSupEndDate”).focus();
valid = false;
}

else if (valid) {
//var url = “/LegalDocument/VerifyDocument/”;
//var url = ‘(@System.Configuration.ConfigurationManager.AppSettings[“PageURL”])LegalDocument/VerifyDocument’;
//var url: ‘http://’ + window.location.host + ‘/LegalDocument/Logoutmethod’,
$(“#btnUserRegistration”).val(‘Plesae wait..’);
$(“#btnUserRegistration”).attr(“style”, “background:Gray”)
$(“#btnUserRegistration”).attr(“disabled”, true);
$.ajax({
url: ‘http://’ + window.location.host + ‘/LegalDocument/VerifyDocument’,
data: { Caseno: txtCaseno, Court: txtCourt, FName: txtFirstName, LName: txtLastName, Address: txtAddress, RCity: txtRegistrationCity, RState: txtRegistrationState, Zipcode: txtZipCode, RCountry: txtRegistrationCountry, DoArrest: txtDateofArrest, Offense: txtOffense, LoSupervison: txtLengthofSupervison, SEDate: txtSupEndDate },
cache: false,
type: “POST”,
success: function (data) {
debugger;
if (data == “userE”) {
alert(“user registration successfully”);
$(‘#SubmitData’).submit();

} else {
alert(“This Email id Already Exist in DataBase.”);
$(“#btnUserRegistration”).val(‘SIGNUP’);
$(“#btnUserRegistration”).attr(“style”, “background:rgba(0, 0, 0, 0) linear-gradient(to bottom, rgba(43, 59, 146, 1) 0%, rgba(24, 38, 117, 1) 100%) repeat scroll 0 0”)
$(“#btnUserRegistration”).attr(“disabled”, false);
return false;
}
$(“#txt_Email”).attr({ ‘value’: ” });

},
error: function (reponse) {
alert(“error : ” + reponse);
}
});

}

}

function ContactUsValidate() {
var valid = true;
var mob = /^[1-9]{1}[0-9]{9}$/;

debugger;
if ($(“#txtName”).val() == “”
&& $(“#txtEmail”).val() == “”
&& $(“#txtPhoneNo”).val() == “”
&& $(“#AreatxtMessage”).val() == “”) {
$(‘#txtName’).css(‘border-color’, ‘red’);
$(‘#txtEmail’).css(‘border-color’, ‘red’);
$(‘#txtPhoneNo’).css(‘border-color’, ‘red’)
$(‘#AreatxtMessage’).css(‘border-color’, ‘red’);
valid = false;
$(“#txtName”).focus();
}
else if ($(“#txtName”).val() == “”) {
$(‘#txtName’).css(‘border-color’, ‘red’);
$(“#txtName”).focus();
valid = false;

}
else if ($(“#txtEmail”).val() == “”) {
$(‘#txtEmail’).css(‘border-color’, ‘red’);
$(“#txtEmail”).focus();
valid = false;
}
else if (!ValidateLoginEmail($(“#txtEmail”).val())) {
alert(“Please Enter a valid Email id”);
$(‘#txtEmail’).css(‘border-color’, ‘red’);
$(“#txtEmail”).focus();
valid = false
}
else if ($(“#txtPhoneNo”).val() == “”) {
$(‘#txtPhoneNo’).css(‘border-color’, ‘red’);
$(“#txtPhoneNo”).focus();
valid = false;

}
else if (!mob.test($(‘#txtPhoneNo’).val())) {
alert(‘Please Enter Valid Phone no’);
$(‘#txtPhoneNo’).css(‘border-color’, ‘red’);
$(“#txtPhoneNo”).focus();
valid = false;
}
else if ($(‘#AreatxtMessage’).val() == “”) {
$(‘#AreatxtMessage’).css(‘border-color’, ‘red’);
$(“#AreatxtMessage”).focus();
valid = false;
}
else if ($(‘#AreatxtMessage’).val() != “”) {
var min = 100;
var len = $(‘#AreatxtMessage’).val().length;
if (len 64 && charCode 96 && charCode = 48 && charCode = 65 && charCode = 97 && charCode = 48 && charCode <= 57) || charCode == 8
|| charCode == 127 || charCode == 32 || charCode == 0 || charCode == 11)
return true;
else
alert('Please Enter only Numeric number ')
return false;
}
catch (err) {
alert(err.Description);
}
}

function removeLoginsession() {
debugger;

//var url1 = '@System.Configuration.ConfigurationManager.AppSettings["PageURL"]/LegalDocument/Logoutmethod';
//var url2 = '@System.Configuration.ConfigurationManager.AppSettings["PageURL"]/LegalDocument/Index';
//url1 = '../../LegalDocument/Logoutmethod';
//url2 = '../../LegalDocument/Index';
$.ajax({

//url: url1,
url: 'http://&#039; + window.location.host + '/LegalDocument/Logoutmethod',
cache: false,
type: "POST",
success: function (data) {
window.location.href = 'http://&#039; + window.location.host + '/LegalDocument/Index';
//url: 'http://&#039; + window.location.host + '/LegalDocument/Index';
},
error: function (reponse) {
alert("error : " + reponse);
}
});
}

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s