彈出模態(tài)框modal的實(shí)現(xiàn)方法及實(shí)例
彈出模態(tài)框modal的實(shí)現(xiàn)方法及實(shí)例
一個(gè)簡(jiǎn)單的點(diǎn)擊列表修改按鈕,彈出bootstrap模態(tài)框,修改狀態(tài)傳到后臺(tái)php
<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('刪除后無(wú)法恢復(fù),確定要?jiǎng)h除嗎')">刪除</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>
<h4 class="modal-title" id="myModalLabel">
請(qǐng)修改回訪狀態(tài)
</h4>
</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" ;
}
}
});
});
如有疑問(wèn)請(qǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
- bootstrap modal+gridview實(shí)現(xiàn)彈出框效果
- 解決bootstrap中使用modal加載kindeditor時(shí)彈出層文本框不能輸入的問(wèn)題
- 擴(kuò)展bootstrap的modal模態(tài)框-動(dòng)態(tài)添加modal框-彈出多個(gè)modal框
- 關(guān)于BootStrap modal 在IOS9中不能彈出的解決方法(IOS 9 bootstrap modal ios 9 noticework)
- bootstrap modal彈出框的垂直居中
- js showModalDialog彈出窗口實(shí)例詳解
- jQuery+jqmodal彈出窗口實(shí)現(xiàn)代碼分明
相關(guān)文章
ThinkPHP寫(xiě)數(shù)組插入與獲取最新插入數(shù)據(jù)ID實(shí)例
這篇文章主要介紹了ThinkPHP寫(xiě)數(shù)組插入與獲取最新插入數(shù)據(jù)ID的方法,實(shí)例講述了ThinkPHP基于數(shù)組操作數(shù)據(jù)庫(kù)的方法,具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2014-11-11
thinkphp中ajax與php響應(yīng)過(guò)程詳解
這篇文章主要介紹了thinkphp中ajax與php響應(yīng)過(guò)程,以實(shí)例形式詳細(xì)分析了ThinkPHP框架中Ajax響應(yīng)方式的處理原理及實(shí)現(xiàn)過(guò)程,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2014-12-12
析構(gòu)函數(shù)與php的垃圾回收機(jī)制詳解
在PHP中,沒(méi)有任何變量指向這個(gè)對(duì)象時(shí),這個(gè)對(duì)象就成為垃圾。PHP會(huì)將其在內(nèi)存中銷(xiāo)毀。這是PHP的GC(Garbage Collector)垃圾處理機(jī)制,防止內(nèi)存溢出2013-10-10
php實(shí)現(xiàn)在線生成條形碼示例分享(條形碼生成器)
php實(shí)現(xiàn)在線生成條形碼,可以做一個(gè)條形碼生成器,大家參考使用吧2013-12-12
php 與 nginx 的處理方式及nginx與php-fpm通信的兩種方式
這篇文章主要介紹了php 與 nginx 的兩種處理方式及nginx與php-fpm通信的兩種方式,需要的朋友可以參考下2018-09-09
CI框架中數(shù)據(jù)庫(kù)操作函數(shù)$this->db->where()相關(guān)用法總結(jié)
這篇文章主要介紹了CI框架中數(shù)據(jù)庫(kù)操作函數(shù)$this->db->where()相關(guān)用法,結(jié)合實(shí)例分析了or_where()、where_in()、or_where_in()、where_not_in()及or_where_not_in()等函數(shù)的使用技巧,需要的朋友可以參考下2016-05-05
利用Laravel生成Gravatar頭像地址的優(yōu)雅方法
Gravatar是一圖像跟隨著您到訪過(guò)的網(wǎng)站,當(dāng)您在博客中留言或發(fā)表文章,它將會(huì)出現(xiàn)在您的名稱(chēng)旁。下面這篇文章主要給大家介紹了關(guān)于利用Laravel如何生成 Gravatar 頭像地址的優(yōu)雅方法,需要的朋友可以參考下。2017-12-12
thinkphp5 框架結(jié)合plupload實(shí)現(xiàn)圖片批量上傳功能示例
這篇文章主要介紹了thinkphp5 框架結(jié)合plupload實(shí)現(xiàn)圖片批量上傳功能,結(jié)合實(shí)例形式分析了thinkphp5 框架結(jié)合plupload實(shí)現(xiàn)圖片批量上傳功能相關(guān)擴(kuò)展類(lèi)定義、使用及前端js等操作技巧,需要的朋友可以參考下2020-04-04

