在删除的时候,再次决定是否要删除,免得删除错了,怎么编写啊?

代码如下:

1<table>   

while(list($yezhuid,$yezhuname)=mysql_fetch_row($res))
{
echo "<tr>";
echo "<form action="deleteyezhu.php" method="post">";
echo "<input name="yezhuid" type="hidden" value=".$yezhuid."/>";
echo "<td>";
echo "<input type="submit" value="删除"/>";
echo "</td>";
echo "<td>".$yezhuname."</td>";
echo "</form></tr>";
echo "";
}

1</table>

现在我想在点击“删除”按钮的时候,弹出一个类似“你真的要删除么?”这样一个消息对话框,如果点击

“是”那么送到“deleteyezhu.php”处理页面去删除,如果点击“否”,那么就什么也不做。
这个代码怎么编写,请大家帮我!谢谢!
---------------------------------------------------------------

1<script language="javascript">   
2function delconfirm()   
3{ if(confirm("确定要删除?"))   
4return ture;   
5else   
6return false;   
7}   
8</script>
1<form action="**" onsubmit="return delconfirm()">
2<input type="submit" value="删除"/>
3</form>
Published At
Categories with Web编程
comments powered by Disqus