AJAX form submit exits page in IE


<form id="commentWrite" action="javascript:addComment();" method="post">
    <textarea name="commentMessage" id="commentMessage"></textarea>
    <input type="submit" value="add comment" />
</form>

AddComment() is an AJAX call that reads what you have written in the textarea and submits it to the server without refreshing the page. I have this working perfectly in FF, but for some reason submitting the form in IE makes you leave the page.

I’ve read something about “return false” on anchor onclick callbacks fixing a similar issue, but my case is not anchor nor an onclick.