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

