I have spotted a scenario where the web2py.js trap_form function does not 
work correctly.

https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L265

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.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to