Sabtu, 25 Juli 2020

href confirmation

html
<a href="delete.php?id=22" onclick="return confirm('Are you sure?')">Link</a>
javascript
<script>
function hps(id){
  if (window.confirm('Yakin akan menghapus?'))
  {
    $.post("",{hps:id} ).done(function(response){
      var wnd = window.open("about:blank""""_blank");
      wnd.document.write(response);
      //var node = response.split("<<<");
      //if(node[1]==" ok "){location.reload(true);}
    });  
  }else{
      // They clicked no
  }
}
</script>


aa

html
<a href="delete.php?id=22" onclick="return confirm('Are you sure?')">Link</a>
javascript
<button onclick="if(confirm('Are you sure?')) saveandsubmit(event);"></button>


atau


<button onclick="return confirm('Are you sure?')?saveandsubmit(event):'';"></button>

Tidak ada komentar:

Posting Komentar

Foto Propades