• <legend id='2qcvh0ho'><style id='fsdx77e3'><dir id='eif3hif2'><q id='fj3rllmp'></q></dir></style></legend>

      <tfoot id='zmpwdf1s'></tfoot>
        <i id='2gncww9m'><tr id='idi2c7z2'><dt id='e5n0g0hm'><q id='p73xkbpy'><span id='6pmwlf2c'><b id='jqwwclr9'><form id='p2jr9b9a'><ins id='fvsnoeo1'></ins><ul id='36pwjghs'></ul><sub id='9f6xxj2k'></sub></form><legend id='5tdz87a1'></legend><bdo id='ltl1f8tq'><pre id='3srgszde'><center id='nbhlu1jk'></center></pre></bdo></b><th id='niocg1s4'></th></span></q></dt></tr></i><div id='ty0e0mqq'><tfoot id='s5o7u293'></tfoot><dl id='u53bq8e4'><fieldset id='cvtb5kxv'></fieldset></dl></div>

        <small id='8boydyna'></small><noframes id='k741ikfu'>

          <bdo id='uknnrzhm'></bdo><ul id='nlyhwu6c'></ul>

        精准传达 • 价值共享

        洞悉互联网前沿资讯,探寻网站营销规律

        织梦自定义表单ajax提交表单

        作者: 庚午网络 | 2021-01-28 08:43 |点击:

        自定义 ajax

          <tbody id='ubbtyhyk'></tbody>

          1. <small id='29elvy6y'></small><noframes id='d311fafe'>

            • <bdo id='13x7c6rc'></bdo><ul id='yjciksop'></ul>
                <i id='tq2q2zu8'><tr id='birfp1qy'><dt id='vn2ci50g'><q id='cm30nvwh'><span id='tye5re8v'><b id='dyj3yf1m'><form id='h9oo951u'><ins id='zyvmkdrq'></ins><ul id='zhown2yl'></ul><sub id='vc3u18n0'></sub></form><legend id='bhvtpl2e'></legend><bdo id='qgaxpzdn'><pre id='ovyra23u'><center id='avjh2z4z'></center></pre></bdo></b><th id='0au2t55j'></th></span></q></dt></tr></i><div id='5bz8amoe'><tfoot id='jbn3qqf8'></tfoot><dl id='sjbgkdrr'><fieldset id='pkivioyp'></fieldset></dl></div>
                <tfoot id='agtfp07s'></tfoot>

                1. <legend id='ysmf68wy'><style id='ejlfy1cb'><dir id='w8r8ar9f'><q id='d9xfe794'></q></dir></style></legend>

                  不写死任何东西,借助jquery ajax提交dedecms自定义表单到后台。

                  注意表单部分,此例只做为参考,实际项目中根据自己的情况酌情修改。

                  认真看下面例子中 红色部分

                  <form action="/plus/diy.php" enctype="multipart/form-data" method="post" id="diyform">
                  <input type="hidden" name="action" value="post" />
                  <input type="hidden" name="diyid" value="1" />
                  <input type="hidden" name="do" value="2" />
                  <input type="hidden" name="dede_fields" value="mail_name,text;mail_phone;mail_content,multitext" />
                  <input type="hidden" name="dede_fieldshash" value="86d34525cf75f8652022f6446152028d" />
                  <input type="hidden" name="setup" value="ajax" /><!-- 这是为了跟其他非ajax自定义表单不冲突 -->
                      <div class="mail_rdd">
                          <div class="mail_content">
                              <table border="1" width="100%" class="mail_form">
                              <tr>
                                  <td width="50">
                                      姓名:
                                  </td>
                                  <td class="mail_input_bg1">
                                      <input type="text" name="mail_name" id="mail_name" maxlength="20"/>
                                  </td>
                              </tr>
                              <tr>
                                  <td>
                                      电话:
                                  </td>
                                  <td class="mail_input_bg1">
                                      <input type="text" name="mail_phone" id="mail_phone" maxlength="20"/>
                                  </td>
                              </tr>
                              <tr style="height:240px">
                                  <td>
                                      留言:
                                  </td>
                                  <td class="mail_input_bg3">
                                      <textarea name="mail_content" id="mail_content"></textarea>
                                  </td>
                              </tr>
                              </table>
                              <div class="mail_button_bar">
                                  <div class="mail_button confirm" onclick="send()">
                                  </div>
                              </div>
                          </div>
                      </div>
                  </form>

                   

                  js ajax方法部分

                  <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script>
                  <script>
                  function send(){
                      $.ajax({
                          cache: true,
                          type: "POST",
                          url:"/plus/diy.php",
                          data:$('#diyform').serialize(),// 你的form里面的id
                          success: function(data) {
                              if(data=="success"){
                                  alert('发送成功!');
                              }else{
                                  alert('发送失败!');
                              }
                          }
                      });
                  }
                  </script>

                  打开/plus/diy.php 找到

                  showmsg($bkmsg, $goto);

                   

                  改成
                   

                  $addvalue .= ", '".iconv( "UTF-8", "gb2312//IGNORE" , ${$fieldinfo[0]})."'";

                   

                  另一种js $.post方法

                   

                  var dataString = {
                  	'name':$("#name").val(),
                  	'tel':$("#tel").val(),
                  	'setup':'ajax',
                  	'action':'post',
                  	'diyid':1,
                  	'do':2,
                  	'dede_fields':'name,text;tel,text',
                  	'dede_fieldshash':'6b5fb808a4b9ea6d0603d983246a88a1',
                  };
                  $.post("/plus/diy.php",dataString,function(result){
                  	if(result=="1"){
                  		alert('发送成功!');
                  		$('#diyform').reset();//重置form
                  	}else{
                  		alert('发送失败!');
                  	}
                  });
                  二度创作,如有侵权请联系删除。如没特殊注明,文章均为庚午网络原创,转载请注明https://www.hngengwu.com/gengwuwenku/772.html

                  <small id='4eqbxgu9'></small><noframes id='5zus64jk'>

                2. <legend id='kdktt728'><style id='3l9rmy1t'><dir id='8mlw1x9v'><q id='mfljyjrp'></q></dir></style></legend>

                      <tfoot id='sehjrrtf'></tfoot>

                      • <bdo id='lsvo41e1'></bdo><ul id='quslmarn'></ul>
                      <i id='zku549v5'><tr id='tuqqkyqu'><dt id='w2nerowo'><q id='y6gom45e'><span id='807sm14i'><b id='1ekcjo9z'><form id='hp71vjir'><ins id='5tsot7uh'></ins><ul id='q6cy97sw'></ul><sub id='z3w20anq'></sub></form><legend id='mkzt55zm'></legend><bdo id='7yossukd'><pre id='cnv4rjvn'><center id='j45p6uwp'></center></pre></bdo></b><th id='ykbgwfzt'></th></span></q></dt></tr></i><div id='wjl3m22n'><tfoot id='t7pk62pc'></tfoot><dl id='03heplbo'><fieldset id='1r9mkj50'></fieldset></dl></div>
                      多一份策划方案,总有益处。

                      请直接添加技术总监微信联系咨询

                      网站设计 品牌营销

                      多一份参考,总有益处

                      联系庚午网络,获得专属《策划方案》及报价

                      咨询相关问题或预约面谈,可以通过以下方式与我们联系

                      业务热线:18574395938 / 大客户专线:18574395938