<div >
            <!--表单提交-->
            <form >  
              <!--添加用户 弹窗-->
                <div >
                <div>
		            <label for="txtacno">客户编号</label>
                    <input type="text"  />
                       
                    <label for="txtacname">客户名称</label>
                    <input type="text"  />
                </div>
          </div>
      </div>

 提交:

 $.ajax({
                  url: form.attr('action'),
                  type: form.attr('method'),
                  data: addData + form.serialize(),  //form.serialize()获取所有数据
                  //dataType: "json",
                  async: false,
                  success: function (data) {
                      if (data == "ex") {
                          alert("客户编号已经存在");
                          acno.attr("onfocus", "this.select()"); //获得焦点时全选
                          acno.focus(); //获取焦点
                          return false;
                      }
                      else if (data == "ok") {
                          alert("添加成功");
                          $("#dialog").dialog("close");

                          //触发reset按钮 清空数据
                          //$("#ResetData").click();

                          window.parent.getIndex(); //调用父页面方法 获取当前选项卡的title url
                          window.parent.load(); //刷新页内容
                      }

                      else if (data == "no") {
                          alert("添加失败。请关闭重试");
                          return false;
                      }
                  },
                  error: function (e) {
                      alert("操作失败。请关闭重试");
                      return false;
                  }
              });

 

相关文章:

  • 2022-02-10
  • 2021-12-03
  • 2021-11-27
  • 2021-12-21
  • 2021-12-31
  • 2022-01-12
  • 2021-12-24
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-11-29
  • 2022-02-21
  • 2021-07-07
  • 2022-12-23
相关资源
相似解决方案