0

我想在提交表单之前使用确认框供用户检查。我在我的脚本中使用以下表单标签:

<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>标签中做一些参考?谢谢!

4

1 回答 1

1
onsubmit="return confirm('Are you sure you want to delete it from the database?');"

经测试,有效。我不认为你可以在标签中转义这样的字符。

于 2011-08-27T02:00:57.513 回答