我想在提交表单之前使用确认框供用户检查。我在我的脚本中使用以下表单标签:
<form action="delete.php" method="POST" target="_blank" onsubmit="return confirm(\"Are you sure you want to delete it from the database?\");">
但它不起作用,点击“提交”按钮后,“delete.php”将被执行。谁能帮我弄清楚我哪里出错了?我想知道是不是因为这个“确认”功能是某种内联样式,我需要在<head>
标签中做一些参考?谢谢!