I think I've worked out what I *want* to do, but I'm not sure if this is easy in web2py. I want to use the
onsubmit handler in a form to reload the form from a .load view, but return
false so that the
final submit action is not called. Then, if the reloaded form validates, I can set response.js in the loaded view to actually call .submit() on the form. As I understand, this will
*not* trigger the onsubmit event, but it will go to the url specified in the action. That way I can do, e.g.
<form action="some_other_url" target="_blank" onsubmit="reload_form(); return false;">
...
<input type="submit" />
</form>
and only if the form validates will clicking [submit] open up a new tab containing some_other_url. Otherwise, the form will be reloaded in-situ using AJAX. Is this a reasonable way to proceed, and is there any web2py magic that I could use to help with this? Or will I need to code by hand all the AJAX reloading in the `reload_form()` function shown above, risking duplicating the web2py LOAD() functionality?