gpt4 book ai didi

php - 提交时无法出现确认框

转载 作者:行者123 更新时间:2023-11-28 20:38:09 24 4
gpt4 key购买 nike

我正在尝试使用 onsubmit="return recognize('Do you确实要提交表单吗?')" 在用户通过单击提交按钮删除项目之前显示警告。我无法出现确认框,它只是继续直接删除该项目。

任何人都可以在我的代码中看到我可能出错的地方吗?我尝试过更改双引号和单引号,但没有任何努力让确认框出现。

我的代码如下。

    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>';

最佳答案

更改您的:

return confirm('Do you really want to submit the form?')

return confirm(\'Do you really want to submit the form?\')

这应该可以解决给您带来的任何 qouting 问题,因为它肯定是错误的 qouting。

关于php - 提交时无法出现确认框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14941225/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com