12345678910111213141516171819202122232425262728293031323334353637 |
- $(function(){
- $("#form-question").Validform({
- tiptype: function (msg, o, cssctl) {
- if (o.type == 3) {//失败
- layer.msg(msg, {icon: 5, time: 3000});
- $(window).scrollTop(o.obj.offset().top - 40);
- }
- },
- datatype: {//自定义验证类型
- },
- ignoreHidden: true,
- tipSweep: true, //若为true,则只在表单提交时验证
- ajaxPost: true, //异步提交
- beforeCheck: function (curform) { //验证通过之前执行的函数
- },
- beforeSubmit: function (curform) { //验证通过之后执行的函数
- var questionProfileText = UE.getEditor('questionProfileText').getContent();
- if(questionProfileText == null || questionProfileText == ""){
- vailErrorMsg($("#questionProfile"),"未填写问题描述");
- return false;
- }
- $("#questionProfile").val(questionProfileText);
- },
- callback: function (data) {//异步回调函数
- if (data) {
- var index = layer.alert(data.resultMsg, function (index) {
- if (data.resultCode == 200) {
- location.href = url_path + "/admin/complaintQuestion/question_page";
- } else {
- layer.close(index);
- }
- });
- }
- }
- });
- })
|