This is the form declaration:
<form id="form1" method="post" onsubmit="this.action='/mis_apps/scholarships-syste'+'m/index.cfm/scholarships/edit';">
This my javascript:
$("#form1").attr("action", "/mis_apps/scholarships-syste'+'m/index.cfm/scholarships/test");
alert($("#form1").attr("action"));
$("#form1").unbind("submit").submit();
The alert correct displays the new action. But when submit is ran, it still goes to the original code in the onsubmit.
I also tried:
$("#form1").unbind("submit");
$("#form1").submit();
But it still doesn’t work.
Thank you.
.unbindwill remove only jQuery attached event handlers.Try this,
You can test it here, http://jsfiddle.net/k5Tnh/3/