• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
    問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
    當前位置: 首頁 - 科技 - 知識百科 - 正文

    form表單數(shù)據(jù)封裝成json格式并提交給服務(wù)器的實現(xiàn)方法

    來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-27 22:23:54
    文檔

    form表單數(shù)據(jù)封裝成json格式并提交給服務(wù)器的實現(xiàn)方法

    form表單數(shù)據(jù)封裝成json格式并提交給服務(wù)器的實現(xiàn)方法:1、jsp代碼,form表單: <form action=# id=costForm> <input type=hidden id=userId name=userId/> <div id=COST> <img src='<%=path %>/cvc/center/ima
    推薦度:
    導(dǎo)讀form表單數(shù)據(jù)封裝成json格式并提交給服務(wù)器的實現(xiàn)方法:1、jsp代碼,form表單: <form action=# id=costForm> <input type=hidden id=userId name=userId/> <div id=COST> <img src='<%=path %>/cvc/center/ima

    1、jsp代碼,form表單:

    <form action="#" id="costForm">
    <input type="hidden" id="userId" name="userId"/>
    <div id="COST">
     <img src='<%=path %>/cvc/center/images/close.png' class="close" style="width:34px;position:absolute;right:0px;top:0px;"></img>
     <h2 style="font-weight: bolder;font-size: 14px;">更改該注冊訂單的收費狀態(tài)</h2>
     <ul>
     <li>
     <label for="report">
      是否已報到:
     </label>
     <input type="radio" id="baodao1" name="baodao" value="1"/>是
     <input type="radio" id="baodao0" name="baodao" value="0"/>否
     </li>
     <li>
     <label for="name">
       姓  名:
     </label>
     <span id="costName"></span>
     </li>
     <li>
     <label for="type">
       注冊類型:
     </label>
     <span id="costType"></span>
     </li>
     <li>
     <label for="sure_fee">
      在線支付手續(xù)費:
     </label>
     <span id="costType">0</span>
     </li>
     <li>
     <label for="sure_fee">
       應(yīng)收費金額:
     </label>
     <span id="price"></span>
     </li>
     <li>
     <label for="already_fee">
       已收費金額:
     </label>
     <input type="text" id="pay_" name="pay"/>
     </li>
     <li>
     <label for="owe">
       欠  款:
     </label>
     <span id="qianPay"></span>
     </li>
     <li>
     <label for="fee_type">
       付款方式:
     </label>
     <input type="radio" id="payType1" name="payType" value="3"/>銀行
     <input type="radio" id="payType2" name="payType" value="4"/>郵局
     <input type="radio" id="payType3" name="payType" value="5"/>現(xiàn)金
     <input type="radio" id="payType4" name="payType" value="2"/>在線支付
     </li>
     <li>
     <label for="fee_evidence">
     是否收到匯款憑證:
     </label>
     <input type="radio" id="isReceiveProof1" name="isReceiveProof" value="1"/>是
     <input type="radio" id="isReceiveProof0" name="isReceiveProof" value="0"/>否
     </li>
     <li>
     <label for="fa_piao">
       發(fā)票抬頭:
     </label>
     <span id="billTitle"></span>
     </li>
     
     <li>
     <label for="fa_piao">
       發(fā)票編號:
     </label>
     <input type="text" id="billCode" name="billCode"/>
     </li>
     <li>
     <label for="check_evidence">
     是否已開發(fā)票:
     </label>
     <input type="radio" id="isBill1" name="isBill" value="1"/>是
     <input type="radio" id="isBill0" name="isBill" value="0"/>否
     </li>
     <li>
     <label for="get_evidence">
     是否已領(lǐng)發(fā)票:
     </label>
     <input type="radio" id="isDrawBill1" name="isDrawBill" value="1"/>是
     <input type="radio" id="isDrawBill0" name="isDrawBill" value="0"/>否
     </li>
     <li>
     
     <label for="date">
     已發(fā)確認日期:
     </label>
     <span id="confirmDate"></span>
     <!-- <input type="text" id="confirmDate" name="confirmDate"/> --> 
     <!-- <input id="confirmDate" name="confirmDate" class="text" type="text" onClick="WdatePicker()"/> -->
     </li>
     <li>
     <label for="check_letter">是否已發(fā)確認函:</label>
     <span id="isConfirmInvitation"></span>
     </li>
     <li>
     <label for="fa_piao">在線支付狀態(tài):</label>
     <span id="payString"></span>
     </li>
     </ul>
     <div class="fee_opr">
     <button type="button" class="fee_sure" style="border: none;background: #003260;color: #ffffff;padding: 3px 30px;margin-left: 10px;border-radius: 0px;">確定</button>
     <button type="button" class="fee_cancel" style="border: none;background: #003260;color: #ffffff;padding: 3px 30px;margin-left: 10px;border-radius: 0px;">關(guān)閉</button>
     </div>
    </div>
    </form>

    2、js代碼:

    $(".fee_sure").click(function () {
     var dataObj = $("#costForm").serialize();
     var payType = $('input[name="payType"]:checked').val();
     if(payType == undefined){
     alert("請選擇付款類型");
     return ;
     }else{
     $.ajax({
     url:"/webCenter.do?method=saveUserMessage",
     type: "post", 
     dataType:"json",
     data:dataObj,
     cache:false,
     ifModified:true,
     success:function(json){
     if(json.flag == 1){
     alert("1234");
     }
     }
     })
     }
     })

    3、后臺action處理:

    @RequestMapping(params ="method=saveUserMessage",method=RequestMethod.POST) //導(dǎo)入發(fā)言
     public void saveUserMessage(int userId,HttpServletRequest request,HttpServletResponse response){
     try {
     HttpSession session = this.getSession(request);
     Adminuser adminUser = session.getAttribute("centerAdminUser") == null?null:(Adminuser) session.getAttribute("centerAdminUser");
     if(adminUser == null){
     try {
     response.sendRedirect(request.getContextPath()+"/center/index.jsp");
     } catch (Exception e) {
     e.printStackTrace();
     }
     }else{
     String billNumber = request.getParameter("billCode")==null?"":request.getParameter("billCode");
     String isBaodao = request.getParameter("baodao")==null?"0":request.getParameter("baodao");
     String haspay = request.getParameter("pay")==null?"0":request.getParameter("pay");
     String payType = request.getParameter("payType")==null?"0":request.getParameter("payType");
     String isFkpz = request.getParameter("isReceiveProof")==null?"0":request.getParameter("isReceiveProof");
     String isYkfp = request.getParameter("isBill")==null?"0":request.getParameter("isBill");
     String isYlfp = request.getParameter("isDrawBill")==null?"0":request.getParameter("isDrawBill");
     JSONObject jsonObject = new JSONObject();
     //AdminuserConferences adminuserConferences = webService.getAdminuserConferences(adminUser.getAdminuserId());
     UserInfo userInfo = webService.getUserInfoById(userId);
     if(userInfo!=null)
     {
     jsonObject.accumulate("flag",1);
     ChcRegUser chcRegUser = webService.getChcRegUser(userId);
     if(chcRegUser!=null)
     {
     chcRegUser.setHasPay(Integer.parseInt(haspay));
     chcRegUser.setPayType(Integer.parseInt(payType));
     if(chcRegUser.getHasPay()-chcRegUser.getPay()==0)
     {
     chcRegUser.setStateType(1);
     }
     webService.saveObject(chcRegUser);
     userInfo.setIsBaodao(Integer.parseInt(isBaodao));
     userInfo.setIsFkpz(Integer.parseInt(isFkpz));
     userInfo.setBillNumber(billNumber);
     userInfo.setIsYlfp(Integer.parseInt(isYlfp));
     userInfo.setIsYkfp(Integer.parseInt(isYkfp));
     webService.saveObject(userInfo);
     jsonObject.accumulate("pay", chcRegUser.getPay());
     jsonObject.accumulate("haspay", chcRegUser.getHasPay());
     }
     }else {
     jsonObject.accumulate("flag",0);
     }
     writeJson(response, jsonObject.toString());
     }
     } catch (Exception e) {
     e.printStackTrace();
     }
     }

    以上這篇form表單數(shù)據(jù)封裝成json格式并提交給服務(wù)器的實現(xiàn)方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

    聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    form表單數(shù)據(jù)封裝成json格式并提交給服務(wù)器的實現(xiàn)方法

    form表單數(shù)據(jù)封裝成json格式并提交給服務(wù)器的實現(xiàn)方法:1、jsp代碼,form表單: <form action=# id=costForm> <input type=hidden id=userId name=userId/> <div id=COST> <img src='<%=path %>/cvc/center/ima
    推薦度:
    標簽: 表單 json json格式
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 婷婷国产成人精品视频| 国产亚洲精品资源在线26u| 中文字幕在线精品视频入口一区| 国产高清在线精品二区一| 自拍偷自拍亚洲精品第1页| 亚洲国产精品人人做人人爱| 老司机69精品成免费视频| 国产在线精品一区二区在线观看| 欧美成人精品高清在线播放| 2024国产精品极品色在线| 国产成人精品无码播放| 中文精品人人永久免费| 免费精品精品国产欧美在线| MM1313亚洲精品无码| 国产成人精品久久免费动漫 | 亚洲国产精品无码专区影院 | 国产精品揄拍100视频| 亚洲精品tv久久久久| 精品无码三级在线观看视频| 国产精品v欧美精品v日本精| 久久久精品午夜免费不卡| 国产成人精品无码片区在线观看| 欧洲成人午夜精品无码区久久| 亚洲精品欧美精品日韩精品 | 久久国产乱子伦精品免费午夜| 国产成人精品一区二区三区| 在线人成精品免费视频| 亚洲欧洲国产精品你懂的| 国内精品一级毛片免费看| 精品国产美女福利到在线不卡| 2021国产精品成人免费视频| 精品国产三级a∨在线| 日韩精品真人荷官无码| 亚洲精品无码精品mV在线观看| 中文精品99久久国产| 亚洲国产精品一区二区成人片国内| 亚洲乱码精品久久久久..| 日韩人妻精品无码一区二区三区| 日韩精品系列产品| 日韩精品极品视频在线观看免费| 久久精品国产99久久久|