国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 語(yǔ)言 > JavaScript > 正文

jquery submit()不能提交表單的解決方法

2024-05-06 15:18:06
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

 今天寫表單提交的時(shí)候需要增加一個(gè)確認(rèn)提示,所以沒有使用submit按鈕提交,改用jq的submit(),然后問題了

<form class="form-horizontal m-t" method="post" action="@Url.Action("Edit")" id="form">    <div class="row">      <div class="col-sm-12">        <div class="ibox float-e-margins">          <div class="ibox-title">            <h5>添加</h5>          </div>          <div class="ibox-content">            <div class="form-group">              <label class="col-sm-3 control-label">開始時(shí)間:</label>              <div class="col-sm-8">                <span>                  @(Model.annualRate_beginDate?.ToString("yyyy-MM-dd"))                </span>              </div>            </div>            <div class="form-group">              <label class="col-sm-3 control-label">結(jié)束時(shí)間:</label>              <div class="col-sm-8">                <input type="text" class="form-control" name="annualRate_endDate" id="annualRate_endDate" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" value="@Model.annualRate_endDate.ToString("yyyy-MM-dd")" required>              </div>            </div>            <div class="form-group">              <label class="col-sm-3 control-label">年利息%:</label>              <div class="col-sm-8">                <input type="number" step="0.01" class="form-control" id="annualRate_rate" name="annualRate_rate" value="@Model.annualRate_rate.ToString("#0.00")" required>              </div>            </div>            <div class="form-group">              <div class="col-sm-4 col-sm-offset-2">                <button class="btn btn-lg btn-primary" id="submit_btn" type="button">                  提交                </button>                <a class="btn btn-lg btn-white" href="@Url.Action(" rel="external nofollow" Index")">                  取消                </a>              </div>            </div>          </div>        </div>      </div>    </div>  </form>
<script type="text/javascript">  $(function () {    $("#submit").click(function () {      var start = '@(Model.annualRate_beginDate?.ToString("yyyy-MM-dd"))';      var end = $("#annualRate_endDate").val();      var val = $("#annualRate_rate").val();      layer.confirm('請(qǐng)確認(rèn)所填寫的信息是否正確?<br/>開始時(shí)間:' + start + '<br/>結(jié)束時(shí)間:' + end + '<br/>年利率:' + val, { icon: 3, title: '提示' }, function (index) {        $("#form").submit();        layer.close(index);      });    });  })</script>

點(diǎn)擊提交按鈕出現(xiàn)確認(rèn)提示,但是確認(rèn)后就沒反應(yīng)了

但是將button的type改為submit卻又能提交

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 成武县| 新蔡县| 姚安县| 健康| 乌拉特前旗| 乐山市| 工布江达县| 梁平县| 汉寿县| 承德市| 宁明县| 布尔津县| 商南县| 红原县| 镇康县| 涟源市| 应城市| 金山区| 太保市| 玛纳斯县| 连江县| 高清| 客服| 饶阳县| 洪雅县| 剑川县| 搜索| 尉氏县| 九江市| 禹州市| 吴川市| 东安县| 于都县| 五大连池市| 桂阳县| 锡林浩特市| 新安县| 黑河市| 淄博市| 常山县| 宿松县|