您好,登錄后才能下訂單哦!
使用modal彈出一個模態(tài)框?針對這個問題,這篇文章詳細介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
<a href="" data-toggle=" rel="external nofollow" rel="external nofollow" modal" data-target="#myModal" class="btn btn-success btn-sm edit">修改</a> <!-- <a href="" data-toggle=" rel="external nofollow" rel="external nofollow" modal" data-target="#myModal" class="btn btn-danger btn-xs" onclick="return confirm('刪除后無法恢復(fù),確定要刪除嗎')">刪除</a> --> </td> </tr> @endforeach <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> × </button> <h5 class="modal-title" id="myModalLabel"> 請修改回訪狀態(tài) </h5> </div> <div class="modal-body "> <select class="form-control" id="select"> <option>成功</option> <option>未聯(lián)系</option> <option>失敗</option> </select> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">關(guān)閉 </button> <button type="button" class="btn btn-primary saveId"> 提交更改 </button> </div> </div> </div> </div>
var saveID; $('.table').on('click','.edit',function(){ console.log($(this).parent().parent().attr('data-id')); saveID = $(this).parent().parent().attr('data-id'); }); $('.saveId').click(function(){ console.log(111,saveID); var options = $("#select option:selected"); var status = options.val(); $.ajax({ type: "POST", url: "/subscribe/edit", dataType:"json", data:{ "saveID" :saveID, "status":status, "_token":"{{ csrf_token() }}", }, success: function(data) { if (data.code == 200) { window.location.href="{{ url('subscribe/list') }}" rel="external nofollow" ; } } }); });
關(guān)于使用modal彈出一個模態(tài)框問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注億速云行業(yè)資訊頻道了解更多相關(guān)知識。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。