I have spotted a scenario where the web2py.js trap_form function does not work correctly.
Currently looks like this:
var url = form.attr('action');
if ((url === "") || (url === "#")) {
/* form has no action. Use component url. */
url = action;
}
Hoever, if the form has no attribute called action then the url variable is not defined, which the if statement does not test for.
Can I suggest this code needs changing to the following:
var url = form.attr('action');
if ((url === "") || (url === "#") || (typeof url === 'undefined')) {
/* form has no action. Use component url. */
url = action;
}
Now if the query to get the action attribute of the form return undefined, this will be recognised and the component's url used instead.
Regards.