java servlet and JS

<a href=\"hdata_del?hid="+rs.getObject(1).toString()+"\" target=\"mainFrame\" ><img src=\"cPanel/images/b_delete.jpg\" border=\"0\" onclick=\"javascript:Confirm();\"></a>

I am printing this line in my servlet to with some images.

onlick of this image i need to Delete the records from the table.Before that i need to fire JS function for a Confirmation dialog box.

But the problem is for both YES and NO buttons the record get deleting from the table.How to prevent this.

out.print("<script language=\"JavaScript\" type=\"text/javascript\">");

out.println("function Confirm() {");

out.println("if(confirm(\"Do you wish to DELETE this Record?\")) {");

out.println("return true;");

out.println("}else{");

out.println("return false;}");

out.println("}");

out.print("</script>");

[1129 byte] By [Ajaxranda] at [2007-11-27 2:36:15]
# 1
have you tried removing the 'return false' bit from the js - ie not returning anything? The confirmation window should close when you click cancel and nothing else will happen
yorkroada at 2007-7-12 2:55:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
http://www.shiningstar.net/articles/articles/javascript/confirmsubmit.asp?ID=AW<a href=\"hdata_del?hid="+rs.getObject(1).toString()+"\" target=\"mainFrame\" ><img src=\"cPanel/images/b_delete.jpg\" border=\"0\" onclick=\"return Confirm();\"></a>
tolmanka at 2007-7-12 2:55:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...