Here’s how to change form action with JavaScript and jQuery respectively.
JavaScript - How to Change Form Action
document.xxxForm.action = "URL";
jQuery - How to Change Form Action
$("#xxxForm").attr("action","URL");
That’s all from the Gemba.