The problem: working with a form having a field named action.
The fix: work with form.attributes.
Test: change form action