国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
form 轉(zhuǎn)json最佳示例
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="application/javascript" src="js/jquery-2.0.3.js"></script>
<title>無(wú)標(biāo)題文檔</title>
<script type="application/javascript">
$.fn.serializeObject = function() 
   var o = {}; 
   var a = this.serializeArray(); 
   $.each(a, function() { 
       if (o[this.name]) { 
           if (!o[this.name].push) { 
               o[this.name] = [o[this.name]]; 
           
           o[this.name].push(this.value || ''); 
       } else
           o[this.name] = this.value || ''
       
   }); 
   return o; 
};
function onClik(){
        //var data = $("#form1").serializeArray(); //自動(dòng)將form表單封裝成json
        //alert(JSON.stringify(data));
        var jsonuserinfo = $('#form1').serializeObject();
        alert(JSON.stringify(jsonuserinfo));
}
</script>
<form id="form1" name="form1" method="post" action="">
  <p>進(jìn)貨人 :
    <label for="name"></label>
    <input name="name" id="name" type="text">
  </p>
  <p>性別:
    <label for="sex"></label>
    <select name="sex" size="1" id="sex">
      <option value="1">男</option>
      <option value="2">女</option>
    </select>
  </p>
  <table border="1" width="708">
    <tbody><tr>
      <td width="185">商品名</td>
      <td width="205">商品數(shù)量</td>
      <td width="296">商品價(jià)格</td>
    </tr>
    <tr>
      <td><label for="pro_name"></label>
        <input name="pro_name" id="pro_name" type="text"></td>
      <td><label for="pro_num"></label>
        <input name="pro_num" id="pro_num" type="text"></td>
      <td><label for="pro_price"></label>
        <input name="pro_price" id="pro_price" type="text"></td>
    </tr>
    <tr>
      <td><input name="pro_name2" id="pro_name2" type="text"></td>
      <td><input name="pro_num2" id="pro_num2" type="text"></td>
      <td><input name="pro_price2" id="pro_price2" type="text"></td>
    </tr>
  </tbody></table>
  <p> </p>
  <input name="submit" onclick="onClik();" value="提交" type="button">
</form>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
jquery中$.post 傳輸json數(shù)據(jù)
成功使用vue props
使用Request.From如何獲取非服務(wù)器控件的值
使用表單與用戶(hù)交互
標(biāo)記語(yǔ)言
輸入框失去焦點(diǎn)只能輸入數(shù)字
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服