0

我有这个回声声明:

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

当我按“删除”时,我怎么能做到这一点,会出现一个是否对话框?

我在某处读到它可以在语句的某处添加类似这样的内容:

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

任何帮助,将不胜感激。提前致谢。

4

2 回答 2

4

尝试这个:

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

我摆脱了"."您原始代码中不必要的内容。

于 2013-07-15T01:59:53.087 回答
0

就用这个

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

代替

echo "<td align=center style=border:0>"."<a href='?delete=$row[id]'>Delete</a>"."</td>";
于 2015-08-26T20:47:15.643 回答