$(document).ready(function () { // debugger; /* Client Enquiry Form Posting and Submitting [Start] */ // alert($("#frmEnquiry").length); $("#frmDefaultClientEnquiry").validate({ rules: { FirstName: "required", LastName: "required", Country : "required", Email: { required: true, email: true }, Destination: "required", MoreDetail: "required", ContactNumber: { required: true, number: true, minlength: 10, maxlength: 15 }, TourType: "required", TYear: "required", TMonth: "required" }, messages: { FirstName: "Please enter your first name", LastName:"Please enter your last name", Email: "Please enter a valid email address", Destination: "Please enter a valid destination", MoreDetail: "Please Enter More Details", ContactNumber: "Please enter a valid Number", TourType: "Please enter a valid Tour Type", TYear: "Please enter a valid Year", TMonth: "Please enter a valid Month" }, showErrors: function (errorMap, errorList) { // Clean up any tooltips for valid elements $.each(this.validElements(), function (index, element) { var $element = $(element); $element.attr("title", "").closest("div").removeClass("has-error"); }); // Create new tooltips for invalid elements $.each(errorList, function (index, error) { var $element = $(error.element); $element.attr("title", error.message).tooltip().closest("div").addClass("has-error"); // Create a new tooltip based on the error messsage we just set in the title }); }, focusCleanup: true, submitHandler: function (form) { var result = $('input[name="rdbDefaultCallType"]:checked'); if (result.length > 0) { $('#hdnCallType2').val(result.val()); var resltCallType = $('#hdnCallType2').val(); } else { $('#hdnCallType2').html(""); } debugger; var txtFirstName = $("#txtName").val(); var CarWalwPkg= false; if($( "#ddloptTour option:selected" ).text()==='CARwalle packages') { CarWalwPkg=true; } $.post("../../Package/SubmitEnquiry", $("#frmDefaultClientEnquiry").serialize()) .done(function (data) { // debugger; // $("#txtFirstName").val(''); $("#txtLastName").val(''); $("#txtContact").val(''); $("#txtEmail").val(''); $("#txtMoreDetails").val(''); $("#ddlCountry").val(''); $("#ddlTMonth").val(''); $("#ddlTYear").val(''); $('#ddloptTour').val('') // $("#frmEnquiry").hide(); $("#divEnquiryResponse").html(data).addClass("text-info"); $('#Subject').val(' Quick Enquiry'); $(".q_enq_form").slideToggle('fast'); $(".enq_head").toggleClass('enq_head_plus'); // $.fancybox({ // content: $('#sucess_msg') // }) if(CarWalwPkg) { location.href = "http://Veenaworld.com/ThankYou.html?name="+txtFirstName+"" } else{ location.href = "http://www.veenaworld.com/ThankYouPage.html?name="+txtFirstName+"" } }) .fail(function (data) { //debugger; // $("#frmEnquiry").hide(); $('#Subject').val(' Quick Enquiry'); $("#divEnquiryResponse").html(data).addClass("text-danger"); }); } }); /* Client Enquiry Form Posting and Submitting [End] */ // Quick Call Back Form Posting and Submitting [Start] $("#frmQuickCallBack").validate({ rules: { MobileNo: { required: true, number: true, minlength: 10, maxlength: 15 } }, messages: { MobileNo: "Please enter a valid Number" }, showErrors: function(errorMap, errorList) { // Clean up any tooltips for valid elements $.each(this.validElements(), function(index, element) { var $element = $(element); $element.attr("title", "").closest("div").removeClass("has-error"); }); // Create new tooltips for invalid elements $.each(errorList, function(index, error) { var $element = $(error.element); $element.attr("title", error.message).tooltip().closest("div").addClass("has-error"); // Create a new tooltip based on the error messsage we just set in the title }); }, focusCleanup: true, submitHandler: function(form) { // debugger; $.post("../../Package/SubmitContactNumberEnquiry", $("#frmQuickCallBack").serialize()) .done(function(data) { // debugger; $("#txtMobileNo").val(''); $("#divEnquiryResponse").html(data).addClass("text-info"); $('#Subject').val(' Quick CallBack'); // $(".q_enq_form").slideToggle('fast'); // $(".enq_head").toggleClass('enq_head_plus'); // $.fancybox({ // content: $('#sucess_msg') //}) location.href = "http://www.veenaworld.com/ThankYouPage.html" }) .fail(function(data) { //debugger; // $("#frmEnquiry").hide(); $('#Subject').val(' Quick CallBack'); $("#divEnquiryResponse").html(data).addClass("text-danger"); }); } }); // Quick Call Back Form Posting and Submitting [End] $(".Drop").click(function () { return false; }) // Subscribe New Letter Start $("#frmSubscribe").validate({ rules: { Subscribeemail: { required: true, email: true } }, messages: { Subscribeemail: "Please enter a valid email address" }, showErrors: function (errorMap, errorList) { // Clean up any tooltips for valid elements $.each(this.validElements(), function (index, element) { var $element = $(element); $element.attr("title", "").closest("div").removeClass("has-error"); }); // Create new tooltips for invalid elements $.each(errorList, function (index, error) { var $element = $(error.element); $element.attr("title", error.message).tooltip().closest("div").addClass("has-error"); // Create a new tooltip based on the error messsage we just set in the title }); }, focusCleanup: true, submitHandler: function (form) { // debugger; var email = $('#Subscribeemail').val(); $.get("../Home/SaveSubscription?email=" + email, function (data) { }) .done(function (data) { // debugger; $('#Subscribeemail').val(''); $("#divEnquiryResponse").html(data).addClass("text-info"); $.fancybox({ content: $('#sucess_msg') }) }) .fail(function (data) { /// debugger; $("#divEnquiryResponse").html(data).addClass("text-danger"); $.fancybox({ content: $('#sucess_msg') }) }); } }); // subscribe new ltter end });