D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
designpitara.com
/
js
/
Filename :
custom.js
back
Copy
$(function () { $('#txtusername').val(''); jQuery.validator.addMethod("lettersonly", function (value, element) { return this.optional(element) || /^[a-zA-Z ]+$/i.test(value); }, "Letters only please"); $.validator.addMethod("noSpace",function(b,a){return b.indexOf(" ")<0&&b!==""},"Enter without any spaces ."); // $.validator.addMethod("isSpecialChars",function(b,a){return this.optional(a)||/^[0-9a-zA-Z- ,_@.#&\/-\\s]+$/.test(b)},"Special Characters are not allowed"); $.validator.addMethod("isSpecialChars",function(b,a){return this.optional(a)||/^[0-9a-zA-Z- ,_@.#&\/-\\s]+$/.test(b)},"Special Characters are not allowed"); $.validator.addMethod("emailFormat",function(b,a){return this.optional(a)||/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z]{2,4}$/.test(b)},"This E-Mail id has Invalid Format."); $('#mainPopupForm').validate({ rules: { companyname: { required: true }, "project[]": { required: true }, name: { required: true, lettersonly: true, isSpecialChars:true }, email: { required: true, emailFormat:true, remote: { url: 'ajax/check-user-email.php', type: 'POST' } }, phone: { required: true, digits: true, maxlength: 10, minlength: 10 }, firstCaptcha:{ required: true } }, messages: { "project[]": "You must check at least 1 box", email: { required: "Enter valid E-Mail id", remote: "Enter valid E-Mail id." }, phone: { required: "Enter valid 10 digit phone number." }, firstCaptcha:{ required: "Please check on the reCAPTCHA box." } }, submitHandler: function (form) { $.ajax({ type: 'post', url: 'ajax/send-mail.php', data: $(form).serialize(), // dataType:"json", beforeSend: function () { $("#mainPopupFormBtn").prop('disabled', true); // disable button $("#mainPopupFormBtn").text('Please Wait...'); // disable button }, success: function (response) { // console.log(response); // alert(response); var data = JSON.parse(response); if (data.status == "true") { // alert(data.msg); $('#myModalMessage #myMessages').html(data.captchaError); $('#myModal1').modal('hide'); $('#myModalMessage').modal('show'); setTimeout(function () { window.location.reload(); }, 2000); } else { $('.modal .modal-footer .formError').html(data.captchaError); $(".modal .modal-footer .formError").css("display", "block"); $('#myModal1').modal('show'); setTimeout(function () { $(".modal .modal-footer .formError").css("display", "none"); }, 2000); } }, complete: function () { $("#mainPopupFormBtn").prop('disabled', false); // disable button $("#mainPopupFormBtn").text('Submit'); // disable button } }); return false; } }); $('#mainPopupFormSecond').validate({ rules: { companyname: { required: true }, name: { required: true, lettersonly: true }, email: { required: true, emailFormat:true, remote: { url: 'ajax/check-user-email.php', type: 'POST' } }, phone: { required: true, digits: true, maxlength: 10, minlength: 10 }, secondCaptcha:{ required: true } }, messages: { email: { required: "Enter valid E-Mail id", remote: "Enter valid E-Mail id." }, phone: { required: "Enter valid 10 digit phone number." }, secondCaptcha:{ required: "Please check on the reCAPTCHA box." } }, submitHandler: function (form) { $.ajax({ type: 'post', url: 'ajax/consultation-now-mail.php', data: $(form).serialize(), // dataType:"json", beforeSend: function () { $("#mainPopupFormSecondBtn").prop('disabled', true); // disable button $("#mainPopupFormSecondBtn").text('Please Wait...'); // disable button }, success: function (response) { // console.log(response); //alert(response); var data = JSON.parse(response); if (data.status == "true") { // alert(data.msg); $(".modal .modal-footer .formError").css("display", "block"); $('#myModalMessage #myMessages').html(data.captchaError); $('#myModal2').modal('hide'); $('#myModalMessage').modal('show'); setTimeout(function () { window.location.reload(); }, 2000); } else { //alert(data.captchaError); $('.modal .modal-footer .formError').html(data.captchaError); $(".modal .modal-footer .formError").css("display", "block"); $('#myModal2').modal('show'); setTimeout(function () { $(".modal .modal-footer .formError").css("display", "none"); }, 2000); } }, complete: function () { $("#mainPopupFormSecondBtn").prop('disabled', false); // disable button $("#mainPopupFormSecondBtn").text('Submit'); // disable button } }); return false; } }); $('#contactUsForm').validate({ rules: { brand: { required: true }, name: { required: true, lettersonly: true }, email: { required: true, emailFormat:true, remote: { url: 'ajax/check-user-email.php', type: 'POST' } }, phone: { required: true, digits: true, maxlength: 10, minlength: 10 }, service:{ required: true }, message:{ required: true }, firstCaptcha:{ required: true } }, messages: { email: { required: "Enter valid E-Mail id", remote: "Enter valid E-Mail id." }, phone: { required: "Enter valid 10 digit phone number." }, firstCaptcha:{ required: "Please check on the reCAPTCHA box." } }, submitHandler: function (form) { $.ajax({ type: 'post', url: 'ajax/contact-us-mail.php', data: $(form).serialize(), // dataType:"json", beforeSend: function () { $("#contactUsFormBtn").prop('disabled', true); // disable button $("#contactUsFormBtn").text('Please Wait...'); // disable button }, success: function (response) { // console.log(response); //alert(response); var data = JSON.parse(response); if (data.status == "true") { // alert(data.msg); $(".modal .modal-footer .formError").css("display", "block"); $('#myModalMessage #myMessages').html(data.captchaError); $('#myModalMessage').modal('show'); setTimeout(function () { window.location.reload(); }, 2000); } else { //alert(data.captchaError); $('#formErrorMessage').html(data.captchaError); $("#formErrorMessage").css("display", "block"); setTimeout(function () { $("#formErrorMessage").css("display", "none"); }, 2000); } }, complete: function () { $("#contactUsFormBtn").prop('disabled', false); // disable button $("#contactUsFormBtn").text('Submit'); // disable button } }); return false; } }); $('#aboutUsFrom').validate({ rules: { name: { required: true, lettersonly: true }, phone: { required: true, digits: true, maxlength: 10, minlength: 10 }, service:{ required: true }, message:{ required: true }, firstCaptcha:{ required: true } }, messages: { email: { required: "Enter valid E-Mail id", remote: "Enter valid E-Mail id." }, phone: { required: "Enter valid 10 digit phone number." }, firstCaptcha:{ required: "Please check on the reCAPTCHA box." } }, submitHandler: function (form) { $.ajax({ type: 'post', url: 'ajax/about-us-mail.php', data: $(form).serialize(), // dataType:"json", beforeSend: function () { $("#aboutUsFromBtn").prop('disabled', true); // disable button $("#aboutUsFromBtn").text('Please Wait...'); // disable button }, success: function (response) { // console.log(response); //alert(response); var data = JSON.parse(response); if (data.status == "true") { // alert(data.msg); $(".modal .modal-footer .formError").css("display", "block"); $('#myModalMessage #myMessages').html(data.captchaError); $('#myModalMessage').modal('show'); setTimeout(function () { window.location.reload(); }, 2000); } else { //alert(data.captchaError); $('#formErrorMessage').html(data.captchaError); $("#formErrorMessage").css("display", "block"); setTimeout(function () { $("#formErrorMessage").css("display", "none"); }, 2000); } }, complete: function () { $("#aboutUsFromBtn").prop('disabled', false); // disable button $("#aboutUsFromBtn .txt").text('Send your message'); // disable button } }); return false; } }); });