Form submitting to old action after changing the action via jQuery
This seems that this should be so simple but it's not working. What I'm
doing is getting the old action, adding an ID to the end, and setting the
form action to that. Here's the code:
var action = $('#update-schedule-form').attr('action');
$('#update-schedule-form').attr('action', action + '/1');
I can see that the form's action gets changed in FireBug and in Chrome's
inspector. However, when I click the submit button, it still sends it to
the original action. For example, it shows "/controller/action/1" in code
but submits to "/controller/action". Any ideas what is going on here?
No comments:
Post a Comment