<a href=javascript:dostuff()>click</a>
function dostuff() {
// as before
// either
if (confirmed)
document.location = "whatever you wanted in your href to start with";
// or
document.forms[0].submit();
}
Seems pointless to click a link that sends something to the server, which returns code to display a popup for confirmation, which is then sent to the server. That's one page refresh too many if you ask me. If this approach is really necessary, use ajax.
Also, clicking a link to send a form is generally a really bad idea as well. It's "always" (as close to always that other ways doesn't matter) a button used to submit the form. What you'd achieve is most likely to confuse users, or even just force them to think. Go with a submit button and they won't have to.