我试图使用onsubmit="return confirm('Do you really want to submit the form?')"
警告出现在用户通过单击提交按钮删除项目之前。我无法得到一个确认框出现它只是继续直接删除该项目。无法获得确认框出现在提交
任何人都可以在我的代码中看到我可能会出错吗?我试图更改双引号和单引号,但没有努力获得确认框出现。
我的代码如下。
echo '<td> <form method="post" action="deleteassign.php" name="deleteassignform"
id="deleteassignform" onsubmit="return confirm('Do you really want to submit the form?')">';
echo '<input type="hidden" name="quizidvalue" id="quizidvalue" value="'.$sendquizid.'" />';
echo '<input type="hidden" name="classidvalue" id="classidvalue" value="'.$sendclassid.'" />';
echo '<input type="submit" name="deleteassignment" id="deleteassignment" value="Delete This Assignment"> </form> </td> </tr>';
回显'$ sendquizid'时,您可能应该使用[htmlspecialchars](http://php.net/htmlspecialchars)。 – 2013-02-18 16:52:40
现在你的引用发疯了,实际上你正在关闭你的'echo'语句。你应该使用'?>