javascript confirm dialog not working properly

slidulrastag

New Member
i've been trying to get a confirm box to work, i am using php and jquery to make a confirm box appear when clicking on a delete link, actual code :\[code\]$(document).ready(function(){ if (jQuery("a.delete-link").length > 0) { $("a.delete-link").bind("click", function(){ return confirm("Sunteti sigur ca doriti sa stergeti?"); }); }});\[/code\]and the link is called :\[code\]<a href="javascript:void(0);" class="formSubmit delete-link" id="sterge">sterge</a>\[/code\]the link is used to submit a form when clicked, the code for that is :\[code\]$(document).ready(function(){ if ($(".formSubmit").length > 0) { if ($(".formSubmit").parents("form").find("input:submit").length == 0) { $(".formSubmit").parents("form").append('<div style="width:1px;height:1px;overflow:hidden;"><input style="width:0;height:0;overflow:hidden;" type="submit" /></div>'); } $(".formSubmit").click(function(){ $(this).parents("form").trigger("submit"); return false; }); }});\[/code\]i do get the confirm dialog, but any option i chose, the form submits and the delete action is called.. any idea what i'm doing wrong ?
 
Top