function imstat(obj, classid, url) { var mail = ''; if ($(obj).prop('title') == '') { mail = $(obj).text(); } else { mail = $(obj).prop('title'); } var data = {imstat: 'ok', pid: '0', content: mail, classid: classid, fromurl: location.href}; $.ajax({ url: url, type: 'post', cache: false, data: data, success: function (msg) { } }); } function showtipmodal(data) { var tipmodal = $('#tip-modal'); tipmodal.find('#tip-content').html(data); tipmodal.modal('show') } function showinquirymodal() { var inquirymodal = $('#inquiry-modal'); inquirymodal.modal('show') } $().ready(function () { // $("#t1").click(function () { // popwin("detail"); // }); // 提交时验证表单 var validator = $(".form_check").validate({ rules: { subject: { required: true }, email: { required: true, email: true } // message: // { // required: true, // minlength: 10 // } // debug:true }, errorelement: "span", errorplacement: function (error, element) { // append error within linked label $(element) .closest("form") .find("label[for='" + element.attr("id") + "']") .append(error); // error.insertbefore(element) }, submithandler: function (form) { ajaxbodyformsubmit(form); }, }); var validator_side = $('#modal_form_check').validate({ rules: { subject: { required: true }, email: { required: true, email: true } // message: // { // required: true, // minlength: 10 // } // debug:true }, errorelement: "span", errorplacement: function (error, element) { // append error within linked label $(element) .closest("form") .find("label[for='" + element.attr("id") + "']") .append(error); // error.insertbefore(element) }, submithandler: function (form) { ajaxsubmit(form); }, }); function ajaxsubmit(form) { var thatform = $(form) if (thatform.valid()) { $.ajax({ url: '/inquiry_submit', data: thatform.serialize(), type: "post", beforesend: function () { thatform.find('button').attr('disabled', true) thatform.find('.modal_submit_area').slideup() thatform.find('.modal_tip_area .tip_text').text('wait a moment') thatform.find('.modal_tip_area').slidedown() }, success: function (data) { thatform.find('button').attr('disabled', false) thatform[0].reset(); thatform.find('.modal_tip_area .tip_text').text(data) thatform.find('.modal_submit_area').delay(2000).slidedown() thatform.find('.modal_tip_area').delay(2000).fadeout() }, error:function(data){ } }); } } function ajaxbodyformsubmit(form) { var thatform = $(form) if (thatform.valid()) { $.ajax({ url: '/inquiry_submit', data: decodeuricomponent(thatform.serialize(),true), type: "post", datatype: 'text', beforesend: function () { //alert(thatform.find('button').text()); $.fancybox.open('