jquery - .submit() open two tabs instead of one -
("#preview").click(function() { $("form").attr({action: "preview.php", target: "_blank"}).submit(); });
when click on <input type="button" id="preview" />
want submit preview other page. thing is, working jquery open 2 times same tab.
thank help
you try:
$("#preview").click(function(e) { e.stoppropagation(); $("form").attr({action: "preview.php", target: "_blank"}).submit(); });
edit:
i mean:
$("#preview").click(function(e) { $("form").attr({action: "preview.php", target: "_blank"}).submit(); }); $("form").submit(function(e){ e.stoppropagation(); });
Comments
Post a Comment