简体   繁体   English

确认php中的对话框

[英]confirm dialog box in php

I have this echo statement: 我有这个回声声明:

echo "<td align=center style=border:0>"."<a href='?delete=$row[id]'>Delete</a>"."</td>";

how am I able to make that when I press the 'Delete' a yes no dialog box will appear? 当我按下“删除”时,如何使该对话框不出现?

I've read somewhere that it can add some thing like this somewhere in the statement: 我在某处读到它可以在语句中的某处添加这样的内容:

onClick="javascript:return confirm(\'Are you sure you want to delete this record?\')"

Any help would be appreciated. 任何帮助,将不胜感激。 thanks in advance. 提前致谢。

Try this: 尝试这个:

echo "<td align=center style=border:0><a onclick='return confirm(\"Are you sure you want to delete this record?\")' href='?delete=$row[id]'>Delete</a></td>";

I got rid of the unnecessary "." 我摆脱了不必要的"." in your original code. 在您的原始代码中。

Just Use this 只要使用这个

echo "<td align=center style=border:0><a onclick='return confirm(\"Are you sure you want to delete this record?\")' href='?delete=$row[id]'>Delete</a></td>";

Instead of 代替

echo "<td align=center style=border:0>"."<a href='?delete=$row[id]'>Delete</a>"."</td>";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM