【问题标题】:sweet alert (i want to update database status (default:pending) into confirm when i click sweet alert confirm button甜蜜警报(我想在单击甜蜜警报确认按钮时将数据库状态(默认:待定)更新为确认
【发布时间】:2018-03-20 05:09:28
【问题描述】:

这是我的甜心,当我单击此确认按钮时,我想更新我的数据库状态列,请帮助我,谢谢

swal({
    title: 'Are you sure?',
    text: "You won't be able to revert this!",
    type: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#228B22',
    cancelButtonColor: '#d33',
    confirmButtonText: 'Yes, confirm it!'
}).then(function () {
swal(
    'Confirmed!',
    'success'
)
})

【问题讨论】:

标签: php jquery mysql codeigniter


【解决方案1】:

您可以在回调函数中编写代码

检查下面的代码

swal({
  title: 'Are you sure?',
  text: "You won't be able to revert this!",
  type: 'warning',
  showCancelButton: true,
  confirmButtonColor: '#228B22',
  cancelButtonColor: '#d33',
  confirmButtonText: 'Yes, confirm it!'
}).then(function () {

  // write your code in the response of ajax call
  $.ajax({
    url:"",
    success:function(resp){
      swal('Confirmed!','success')
    }
  });
})

【讨论】:

    猜你喜欢
    • 2017-01-04
    • 1970-01-01
    • 2015-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-30
    • 2023-04-03
    • 1970-01-01
    相关资源
    最近更新 更多