Change the button to Regular button instead of Submit and write the code in the click event of the button.
(OR)
Keep the button as Submit and remove the URL in the button properties. Place the code in preSubmit event to set the URL for submit.
The code to set the URL in any of the above approaches:
this.resolveNode("#event").submit.target = "PLACE URL HERE";
Thanks
Srini