Javascript confirm box

javascript

Solution

If you want it to submit after pressing OK, you need to change 1 simple thing. Add a return

onclick="return confirmBox()"

Although I would say:

onsubmit="return confirmBox()"

Problem

i try to use confirm box but it does not work after 'OK' pressing this is my confirm box ``` <script language="JavaScript"> {literal} function confirmBox() { var where_to= confirm("Silmek istediğinizden emin misiniz?"); if (where_to== true) return true; else{ alert("Silme işleminden vazgeçtiniz yönlendiriliyorsunuz"); return false; } } {/literal} </script> <form name="removeFortune" method="post" action="#"> <table border="0" name="tableArticle"> {foreach from=$articles value=article} <tr> <td><input type="checkbox" name="checkArticle[]" value="{$article.id}" /></td> <td>{$article.title}</td> </tr> {/foreach} </table> <input type="submit" onclick="confirmBox()" name="removeArticle" value="Sil" /> <br /><br /> {$deleteMessage} </form> ```

Original source