I built this link:
<a href=""#"" onclick=""this.href='test.asp?Code=123&ReturnTo=test2.asp'; testfunction(this, event); return true;"">
The problem is it sends the user to the link rather than staying on the page, posting to the url and executing the function. Any ideas?