$(document).ready(function () { if(window.location.href.indexOf('Feedback.html') > 0) { $('#i_feedback').hide(); } $("#feedback_form").validate({ rules: { FName: "required", LName: "required", ContactNumber: { required: true, number: true, minlength: 10, maxlength: 15 }, Email: { required: true, email: true }, tsubject: "required", feedback: "required" }, messages: { FName: "Please enter your First Name", ContactNumber: "Please enter a valid Number", Email: "Please enter a valid email address", tsubject: "Please enter Subject", feedback: "Please give your feedback", //MoreDetail: "Please enter MoreDetail", }, 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 txtFirstName = $("#txt_FName").val(); $.post("../Package/SubmitFeedback", $("#feedback_form").serialize()) .done(function (data) { $('#txt_FName').val(''); $('#txt_PhoneNo').val(''); $('#Text1').val(''); $('#txtsubject').val(''); $('#txt_Feedback').val(''); //location.href = "http://veena.quadlabs.net/ThankYouPage.html?name=" + txtFirstName + "" $("#divEnquiryResponse").html(data).addClass("text-info"); $('#Subject').val('Feedback'); $.fancybox({ content: $('#sucess_msg') }) }) .fail(function (data) { $('#Subject').val('Feedback'); //$("#divEnquiryResponse").html(data).addClass("text-danger"); }); } }); $(".Drop").click(function () { return false; }) });