URL Copied...

var remember = $.cookie('defaultCheck1'); if (remember == 'true') { var email = $.cookie('dl_uname'); var password = $.cookie('dl_pass'); $('#dl_uname').val(email); $('#dl_pass').val(password); $('.palceholder1').hide(); } $("#dl_login-btn1").click(function () { var dl_uname = $('#dl_uname').val(); var dl_pass = $('#dl_pass').val(); var login_captch = $('#login_captch').val(); if (dl_uname == '') { $('#dl_uname').focus(); $('#dl_uname').css('border-color', 'red'); return false; } else if (dl_pass == '') { $('#dl_uname').css('border-color', '#ced4da'); $('#dl_pass').css('border-color', 'red'); $('#dl_pass').focus(); return false; } else if (login_captch == '') { $('#dl_uname').css('border-color', '#ced4da'); $('#dl_pass').css('border-color', '#ced4da'); $('#login_captch').css('border-color', 'red'); $('#login_captch').focus(); return false; } var captchaVal = $("#cap_code1").text(); var captchaCode = $(".login_captch").val(); //alert('captchaVal - '+captchaVal); if (captchaVal != captchaCode) { alert("Please Enter Correct Captcha Code") return false; } $.post("/accounts/user_authenticate/", { 'dl_uname': dl_uname, 'dl_pass': dl_pass, 'captchaCode': captchaCode, 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, function (data) { var response = JSON.parse(data); if (response['message'] === "User Login Successfully.") { $('#login_form').submit(); if ($('#defaultCheck1').is(':checked')) { var email = $('#dl_uname').val(); var password = $('#dl_pass').val(); $.cookie('dl_uname', email, {expires: 14}); $.cookie('dl_pass', password, {expires: 14}); $.cookie('defaultCheck1', true, {expires: 14}); } else { $.cookie('dl_uname', null); $.cookie('dl_pass', null); $.cookie('defaultCheck1', null); } } else if(response['message'] === "The user is valid, but the account has been disabled!"){ $("#user_errors").css({"display": "none"}); $("#user_inactive").css({"display": "block", "font-size": "14px", "color": "red"}); $('#dl_uname').css('border-color', '#ced4da'); $('#dl_pass').css('border-color', '#ced4da'); $('#dl_uname').val(''); $('#dl_pass').val(''); } else if(response['message'] === "Please fill the captcha code."){ $("#user_errors").css({"display": "none"}); $("#user_captcha").css({"display": "block", "font-size": "14px", "color": "red"}); $('#dl_uname').css('border-color', '#ced4da'); $('#dl_pass').css('border-color', '#ced4da'); $('#dl_uname').val(''); $('#dl_pass').val(''); $("#login_captch").val(); } else { $("#user_inactive").css({"display": "none"}); $("#user_errors").css({"display": "block", "font-size": "14px", "color": "red"}); $('#dl_uname').css('border-color', '#ced4da'); $('#dl_pass').css('border-color', '#ced4da'); $('#login_captch').css('border-color', '#ced4da'); $('#dl_uname').val(''); $('#dl_pass').val(''); $("#login_captch").val(''); } }); }); $("#quick_login").click(function () { var activation_code = $('#activation_code1').val(); if (activation_code.length != 0) { var otp_code1 = false; // $('#otp_code1').val(); $.post("/accounts/verify_otp/", { 'phone_number': $('#phone').val(), 'otp_code': $('#activation_code1').val(), 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, function (data) { var response = JSON.parse(data); if(response['number']) { alert('OTP Verified Successfully ...'); // if (activation_code === otp_code1) { $("#code_error1").css({"display": "none"}); var contact_number1 = $('#phone').val(); $.post("/accounts/quick_login/", { 'contact_number1': contact_number1, 'goback_url': '', 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, function (data) { var response = JSON.parse(data); if (response['message'] === "Successfully logged in") { console.log("" + response['dashboard_path']); window.location.href = "" + response['dashboard_path']; } else { alert(response['message']); } }); } else { alert('OTP Verification Failed ...'); $("#code_error1").css({"display": "block", "font-size": "12px", "color": "red", "margin-left": "10%", "text-align":"left"}).text("Wrong OTP"); return false; } }); } else { $("#code_error1").css({ "display": "block", "font-size": "12px", "color": "red" }).text(" Please Enter a OTP"); return false; } }); $("#quick_signup").click(function () { var activation_code2 = $('#activation_code2').val(); if (activation_code2.length != 0) { var otp_code2 = $('#otp_code2').val(); $.post("/accounts/verify_otp/", { 'phone_number': $('#phone1').val(), 'otp_code': $('#activation_code2').val(), 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, function (data) { var response = JSON.parse(data); if(response['number']) { alert('OTP Verified Successfully ...'); // if (activation_code2 === otp_code2) { $("#code_error2").css({"display": "none"}); var contact_number2 = $('#phone1').val(); $.post("/accounts/quick_signup/", { 'contact_number2': contact_number2, 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, function (data) { var response = JSON.parse(data); if (response['message'] === "Successfully logged in") { window.location.href = "" + response['dashboard_path']; } else { alert(response['message']); } }); } else { alert('OTP Verified Failed ...'); $("#code_error2").css({"display": "block", "font-size": "12px", "color": "red", "margin-left": "10%", "text-align":"left"}).text("Wrong OTP"); return false; } }); } else { $("#code_error2").css({ "display": "block", "font-size": "12px", "color": "red" }).text(" Please Enter a OTP"); return false; } }); // Country Code var telInput = $("#phone"), errorMsg = $("#phone_error"), validMsg = $("#valid-msg"); // initialise plugin telInput.intlTelInput({ allowExtensions: true, formatOnDisplay: true, autoFormat: true, autoHideDialCode: true, autoPlaceholder: true, defaultCountry: "auto", ipinfoToken: "yolo", nationalMode: false, numberType: "MOBILE", //onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'], preferredCountries: ['sa', 'ae', 'qa', 'om', 'bh', 'kw', 'ma'], preventInvalidNumbers: true, separateDialCode: true, initialCountry: 'auto', geoIpLookup: function (callback) { callback('in'); }, utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/11.0.9/js/utils.js" }); var reset = function () { telInput.removeClass("error"); errorMsg.addClass("hide"); validMsg.addClass("hide"); }; // on blur: validate telInput.blur(function () { reset(); if ($.trim(telInput.val())) { if (telInput.intlTelInput("isValidNumber")) { errorMsg.css({"display": "none"}); errorMsg.addClass("Valid"); } else { // Handling new 6xxx series as Google libphonenumber API still not updated 06Mar2021 if($.trim(telInput.val()) >= 6000000000 && $.trim(telInput.val()) <= 6988999999) { errorMsg.css({"display": "none"}); errorMsg.addClass("Valid"); } else { errorMsg.css({"display": "block", "font-size": "12px", "color": "red"}); errorMsg.addClass("InValid"); telInput.val("").focus(); $("#code_div_1").css({"display": "none"}); return false; } } } }); // on keyup / change flag: reset telInput.on("keyup change", reset); function handle_isValidNumber() { errorMsg.css({"display": "none"}); errorMsg.addClass("Valid"); $("#code_div_1").css({"display": "block"}); $("#phone_error").css({"display": "none"}); $.post("/accounts/generate_otp/", {'phone_number': $('#phone').val(),'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val()}, function (data) { var response = JSON.parse(data); if(response['number']) { alert("OTP Sent Successfully ..."); } else { alert(response['message']) } }); } $('#request_code_1').click(function () { reset(); if ($.trim(telInput.val())) { if (telInput.intlTelInput("isValidNumber")) { handle_isValidNumber(); } else { // Handling new 6xxx series as Google libphonenumber API still not updated 06Mar2021 if($.trim(telInput.val()) >= 6000000000 && $.trim(telInput.val()) <= 6988999999) { handle_isValidNumber(); } else { errorMsg.css({"display": "block", "font-size": "12px", "color": "red"}); errorMsg.addClass("InValid"); telInput.val("").focus(); $("#code_div_1").css({"display": "none"}); return false; } } } }); var telInput2 = $("#phone1"), errorMsg2 = $("#phone_error2"), validMsg2 = $("#valid-msg"); // initialise plugin telInput2.intlTelInput({ allowExtensions: true, formatOnDisplay: true, autoFormat: true, autoHideDialCode: true, autoPlaceholder: true, defaultCountry: "auto", ipinfoToken: "yolo", nationalMode: false, numberType: "MOBILE", //onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'], preferredCountries: ['sa', 'ae', 'qa', 'om', 'bh', 'kw', 'ma'], preventInvalidNumbers: true, separateDialCode: true, initialCountry: 'auto', geoIpLookup: function (callback) { callback('in'); }, utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/11.0.9/js/utils.js" }); var reset2 = function () { telInput2.removeClass("error"); errorMsg2.addClass("hide"); validMsg2.addClass("hide"); }; function handle_check_mobile_number(mobile_number) { $.ajax({ type: 'POST', url: "/accounts/check_mobile_number/", data: { number: mobile_number, csrfmiddlewaretoken: 'i5iQ2zz4hw7dli5r9Fe83DkfD2vZgBZ5AFTAWF9RgySOj7CznsFAQAVr27SJP2tW', }, success: function (mobile_exists) { if (mobile_exists == 'True') { telInput2.val(''); telInput2.css({'display': 'block', 'border-color': 'red'}) alert("Mobile Number Already Exist"); return false; } else { $.ajax({ type: 'POST', url: "/accounts/check_username/", data: { username: mobile_number, csrfmiddlewaretoken: 'i5iQ2zz4hw7dli5r9Fe83DkfD2vZgBZ5AFTAWF9RgySOj7CznsFAQAVr27SJP2tW', }, success: function (data) { if (data == "true") { telInput2.val(''); telInput2.css({'display': 'block', 'border-color': 'red'}) alert('Username Already Exist'); return false; } else { telInput2.css({'display': 'block', 'border-color': 'lightgrey'}) } }, error: function (xhr1, msg1, err1) { } }); telInput2.css({'display': 'block', 'border-color': 'lightgrey'}) } }, error: function (xhr, msg, err) { } }); } // on blur: validate telInput2.blur(function () { reset2(); if ($.trim(telInput2.val())) { if (telInput2.intlTelInput("isValidNumber")) { errorMsg2.css({"display": "none"}); errorMsg2.addClass("Valid"); handle_check_mobile_number(telInput2.val()); } else { // Handling new 6xxx series as Google libphonenumber API still not updated 06Mar2021 if($.trim(telInput2.val()) >= 6000000000 && $.trim(telInput2.val()) <= 6988999999) { errorMsg2.css({"display": "none"}); errorMsg2.addClass("Valid"); handle_check_mobile_number(telInput2.val()); } else { errorMsg2.css({"display": "block", "font-size": "12px", "color": "red"}); errorMsg2.addClass("InValid"); telInput2.val(""); $("#code_div_2").css({"display": "none"}); } } } }); // on keyup / change flag: reset telInput2.on("keyup change", reset); function handle_isValidNumber2() { errorMsg2.css({"display": "none"}); errorMsg2.addClass("Valid"); $("#code_div_2").css({"display": "block"}); $("#phone_error2").css({"display": "none"}); $.post("/accounts/generate_otp/", {'phone_number': $('#phone1').val(),'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val()}, function (data) { var response = JSON.parse(data); if(response['number']) { alert("OTP Sent Successfully ..."); } else { alert(response['message']) } }); } $('#request_code_2').click(function () { reset2(); if ($.trim(telInput2.val())) { if (telInput2.intlTelInput("isValidNumber")) { handle_isValidNumber2(); } else { // Handling new 6xxx series as Google libphonenumber API still not updated 06Mar2021 if($.trim(telInput2.val()) >= 6000000000 && $.trim(telInput2.val()) <= 6988999999) { handle_isValidNumber2(); } else { errorMsg2.css({"display": "block", "font-size": "12px", "color": "red"}); errorMsg2.addClass("InValid"); $("#code_div_2").css({"display": "none"}); $('#phone1').val("").focus(); return false; } } } }); $("#designation").on('change', function () { var designation = $('#designation').val(); var city_id = $('#city').val(); $.ajax({ type: 'POST', url: "/masters/check_designation/", data: { 'designation': designation, 'city_id': city_id, 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, success: function (data) { console.log(data); if (data == "True") { alert('This city already have ' + $('#designation :selected').text()); $('#designation').val(''); return false; } else { $.ajax({ type: 'POST', url: "/masters/user_hierarchy/", data: { 'designation_name': $('#designation :selected').text(), 'city_id': city_id, 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, success: function (data) { console.log(data); var response = JSON.parse(data); $('#reporting_to').empty(); $('#reporting_to').append(''); $('#reporting_to').append(''); for (var i = 0; i < response.length; i++) { if (response[i].reporting_person.split("-")[1] == 'City Head') { $('#reporting_to').append(''); } } }, error: function (xhr, msg, err) { } }); return true; } }, error: function (xhr, msg, err) { } }); }); $("#country").on('change', function () { var country_name = $('#country').val(); $.post('/masters/select_state/', { 'country_name': country_name, 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, function (response) { var response = JSON.parse(response); var response = response[0] $('#state').empty(); $('#state').append(''); for (var i = 0; i < response.length; i++) { $('#state').append(''); } }); }); $("#state").on('change', function () { var state_name = $('#state').val(); $.post('/masters/select_city/', { 'state_name': state_name, 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, function (response) { var response = JSON.parse(response); var response = response[0] $('#city').empty(); $('#city').append(''); for (var i = 0; i < response.length; i++) { $('#city').append(''); } }); }); $("#city").on('change', function () { var city_id = $('#city').val(); $.ajax({ type: 'POST', url: '/masters/select_reporting_person/', data: { 'city_id': city_id, 'state_name': $('#state').val(), 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, success: function (response) { var response = JSON.parse(response); $('#reporting_to').empty(); for (var i = 0; i < response.length; i++) { //if (response[i].reporting_person.split("-")[1] == 'City Head') { $('#reporting_to').append(''); //} } }, error: function (xhr, msg, err) { } }); $.ajax({ type: 'POST', url: "/masters/select_masjid/", data: { 'id': city_id, csrfmiddlewaretoken: 'i5iQ2zz4hw7dli5r9Fe83DkfD2vZgBZ5AFTAWF9RgySOj7CznsFAQAVr27SJP2tW', }, success: function (data) { var response = JSON.parse(data); var response = response[0] $('#ds_masjid_name').empty(); $('#ds_masjid_name').append(''); for (var i = 0; i < response.length; i++) { $('#ds_masjid_name').append(''); } }, error: function (xhr, msg, err) { } }); $.ajax({ type: 'POST', url: "/masters/select_madarsa/", data: { 'id': city_id, csrfmiddlewaretoken: 'i5iQ2zz4hw7dli5r9Fe83DkfD2vZgBZ5AFTAWF9RgySOj7CznsFAQAVr27SJP2tW', }, success: function (data) { var response = JSON.parse(data); $('#ds_madarsa_name').empty(); $('#ds_madarsa_name').append(''); for (var i = 0; i < response.length; i++) { $('#ds_madarsa_name').append(''); } }, error: function (xhr, msg, err) { } }); }); var dtToday = new Date(); var month = dtToday.getMonth() + 1; // getMonth() is zero-based var day = dtToday.getDate(); var year = dtToday.getFullYear(); if (month < 10) month = '0' + month.toString(); if (day < 10) day = '0' + day.toString(); var maxDate = year + '-' + month + '-' + day; $('#ds_dob').attr('max', maxDate); $("#ds_confirm_password").blur(function () { var confirm_password = $("#ds_confirm_password").val(); var password = $("#ds_password").val(); if (password === confirm_password) { $("#password_error").css({"display": "none"}); return true; } else { $("#password_error").css({"display": "block", "font-size": "14px", "color": "red"}); return false; } }); if(code == 'en'){ $("#ds_password").focusout(function () { var pwd = $("#ds_password").val(); var pattern = pwd.replace(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/); if(pwd === ''){ } else if (pwd === pattern) { $("#error_msgs").css({"display": "block", "font-size": "14px", "color": "red"}); return false; } else { $("#error_msgs").css({"display": "none"}); return true; } }); } if(code == 'en'){ $("#ds_username").focusout(function () { var username = $("#ds_username").val(); var username_rplace = username.replace(/\s+/g, ''); if (username_rplace == username) { $("#password_errors").css({"display": "none"}); return true; } else { $("#password_errors").css({"display": "block", "font-size": "14px", "color": "red"}); return false; } }); } var today = new Date(); var tomorrow = new Date(); tomorrow.setDate(today.getDate() - 1); $('#ds_dob').datepicker({ format: 'dd/mm/yyyy', endDate: tomorrow, }); $('#ds_dob').change(function(){ var dob = $('#ds_dob').val(); var sp_id = dob.split("/")[2]; if(parseInt(sp_id) <= 1900){ $('#ds_dob').val('') } }); $('#ds_age').change(function(){ var age = $('#ds_age').val(); if(age < 15){ $('#ds_age').val('15') } }); $(".toggle-password").click(function () { $(this).toggleClass("fa-eye fa-eye-slash"); var input = $($(this).attr("toggle")); if (input.attr("type") == "password") { input.attr("type", "text"); } else { input.attr("type", "password"); } }); }); // Placeholder $('.palceholder').click(function () { $(this).siblings('input').focus(); }); $('.form-control').focus(function () { $(this).siblings('.palceholder').hide(); }); $('.form-control').blur(function () { var $this = $(this); if ($this.val().length == 0) $(this).siblings('.palceholder').show(); }); $('.palceholder2').click(function () { $(this).siblings('input').focus(); }); $('.form-control').blur(function () { var $this = $(this); if ($this.val().length == 0) $(this).siblings('.palceholder2').show(); }); $('.form-control').blur(); // Select $('#my-select').find('li').click(function () { $('#selected').html($(this).html()); }); --> if ($(window).width() <= 992) { $("#dh_nav-l1 li").click(function (e) { $(this).find('ul.dh_dropdown').toggleClass('slideu'); $(this).siblings().find('ul.dh_dropdown').removeClass('slideu'); event.stopImmediatePropagation(); }); } if ($(window).width() <= 992) { $("#dh_nav-l1 li ul li").click(function (e) { $(this).find('ul').toggleClass('slideu'); $(this).siblings().find('ul').removeClass('slideu'); event.stopImmediatePropagation(); }); } $("#dh_nav-l li:nth-child(6)").click(function () { $("#dh_nav-l li:nth-child(6) ul").toggleClass('trigger_01'); }); $(function () { 'use strict'; $('.carousel .carousel-item[data-src]').each(function () { var $this = $(this); $this.prepend([ '
' ].join('')); }); }); $('#dh_owl').owlCarousel({ loop: true, margin: 10, nav: true, dots: false, autoPlay: false, touchDrag: true, smartSpeed: 2000, // duration of change of 1 slide responsive: { 0: { items: 1 }, 600: { items: 1 }, 1000: { items: 1 } } }); $('#dh_owl-1').owlCarousel({ loop: true, margin: 10, nav: true, dots: false, autoPlay: false, touchDrag: true, smartSpeed: 2000, // duration of change of 1 slide responsive: { 0: { items: 1 }, 600: { items: 1 }, 1000: { items: 1 } } }); $('#dh_owl-2').owlCarousel({ loop: true, margin: 10, nav: true, autoPlay: false, touchDrag: true, responsive: { 0: { items: 1 }, 600: { items: 3 }, 1000: { items: 4 } } }); $('#dh_owl-4').owlCarousel({ loop: true, margin: 10, nav: false, autoPlay: true, touchDrag: true, items: 1, autoplayTimeout: 5000, autoplayHoverPause: false, dots: false }); $('#jdl_owl').owlCarousel({ loop: true, margin: 30, nav: false, dotsEach: true, dots: true, responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 3 } } }); $('#jdl_owl-2').owlCarousel({ loop: true, margin: 30, nav: false, dotsEach: true, dots: true, responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 3 } } }); $(".dh_quick-donate-i").click(function () { $(".dh_quick-donate-c").toggleClass('active_bb'); $(".dh_quick-donate-i").toggleClass('active_bi'); }); // Photo function readURL(input, id) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { if (id === 'id_img') { $('#id_proof_img').attr('src', e.target.result); } else if (id === 'imgInp') { $('#blah').attr('src', e.target.result); } } reader.readAsDataURL(input.files[0]); } } $("#imgInp").change(function () { readURL(this, this.id); }); $("#id_img").change(function () { readURL(this, this.id); }); $("body").click(function (e) { var container = $(".d_login-sign-con"); if (!container.is(e.target) && container.has(e.target).length === 0) { $(".d_login-sign-con").css('height', '0'); } }); $("#id_proof").on('change', function () { var id_proof_type = $('#id_proof').val(); if (id_proof_type === '') { $('#img_id').hide(); $('#img_id_button').hide(); } else { $('#img_id').show(); $('#img_id_button').show(); } }); // ID Proof }); function isNumber(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode !== 47) { return false; } return true; } function captchaCode() { var alpha = new Array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); var digit = new Array('1', '2', '3', '4', '5', '6', '7', '8', '9'); var i; for (i = 0; i < 6; i++) { var a = digit[Math.floor(Math.random() * digit.length)]; var b = digit[Math.floor(Math.random() * digit.length)]; var c = digit[Math.floor(Math.random() * digit.length)]; var d = digit[Math.floor(Math.random() * digit.length)]; var e = alpha[Math.floor(Math.random() * alpha.length)]; var f = alpha[Math.floor(Math.random() * alpha.length)]; var g = alpha[Math.floor(Math.random() * alpha.length)]; } var code = a + b + c + d; // + e + f + g; $("#captcha span").remove(); $("#captcha input").remove(); $("#captcha").append("" + code + ""); } function captchaCode1() { var alpha = new Array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); var digit = new Array('1', '2', '3', '4', '5', '6', '7', '8', '9'); var i; for (i = 0; i < 6; i++) { var a = digit[Math.floor(Math.random() * digit.length)]; var b = digit[Math.floor(Math.random() * digit.length)]; var c = digit[Math.floor(Math.random() * digit.length)]; var d = digit[Math.floor(Math.random() * digit.length)]; var e = alpha[Math.floor(Math.random() * alpha.length)]; var f = alpha[Math.floor(Math.random() * alpha.length)]; var g = alpha[Math.floor(Math.random() * alpha.length)]; } var code = a + b + c + d; // + e + f + g; $("#captcha1 span").remove(); $("#captcha1 input").remove(); $("#captcha1").append("" + code + ""); } $(function () { captchaCode(); $('#contactForm').submit(function () { var captchaVal = $("#cap_code").text(); var captchaCode = $(".captcha").val(); if (captchaVal === captchaCode) { $(".captcha").css({ "color": "#609D29" }); } else { $(".captcha").css({ "color": "#CE3B46" }); } }) }); $(function () { captchaCode1(); }); $('#refresh_id').click(function (event) { event.stopPropagation(); $(".d_sign-main").css('height', '600px'); }); $('#dh_reg-btn_register').click(function (event) { event.stopPropagation(); $(".d_login-sign-con").css('height', '570px'); $("#nav-reg-tab").addClass('active_1'); $("#nav-login-tab").removeClass('active_1'); $("#nav-reg").addClass('show active'); $("#nav-login").removeClass('show active'); }); window.setTimeout(function () { $(".alert").fadeTo(500, 0).slideUp(500, function () { $(this).remove(); }); }, 4000); $('#d_nav-tab a').click(function () { $(this).addClass('active_1'); $(this).removeClass('active'); $(this).siblings().removeClass('active_1'); }); -->