0

I have this weird experience right now. and searching all possible answer and tested it and yet nothing works on my situation. My problem is that I have a confirmation when deleting a data, the ok button in confirm working perfectly but when I click cancel still proceed and reload the page.

Here is my quick code preview:

<a href="MY_URL" onclick='return confirm("Are you sure?");'><i class="fa fa-trash"></i></a>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
User Unknown
  • 1,079
  • 1
  • 7
  • 17
  • Unfortunately, without further information about the surrounding UI and the data service, it is not rally possible to answer this question. One can expect that the cancel button needs to stop some kind of XHR request, or signal the server to stop otherwise. Its not possible to tell what the case is with information provided. – Miaplacidus Mar 11 '20 at 19:01
  • @Miaplacidus is it possible the cause of this is from to my extended js script files and jQuery? – User Unknown Mar 11 '20 at 19:05
  • not sure but try: onclick='return confirm("Are you sure?");return false' –  Mar 11 '20 at 19:05
  • @Quarter I already tried that nothing works, its still the same the problem. – User Unknown Mar 11 '20 at 19:08
  • 1
    i tried your code and it works fine in chrome, please give more input on what you are trying. – Jaideep Mar 11 '20 at 19:09
  • Same as @jaideep_johny code works fine in chrome; what browser are you using? –  Mar 11 '20 at 19:10
  • It works from my other project, but on this project when i click the `cancel` it is still reload the page. and also i have a idea it comes from the jquery of the bootstrap? i dont know. if i'm right. – User Unknown Mar 11 '20 at 19:12
  • @KimNicoleSabordo that means this code is working something else is breaking, which requires further info from your end – Jaideep Mar 11 '20 at 19:21

0 Answers0