First, what's wrong with using LOAD?
You can of course submit any form via Ajax, but you'll have to code it
yourself in Javascript (catch the submit event, serialize the form, and
post it via Ajax). Keep in mind that you will still have to deal with
updating the form in the browser after submission (i.e., showing errors in
case validation did not pass, or refreshing the form if submission was
successful) -- the easiest way to do that is probably to return a whole
form in HTML from the server, but by that point, you're just replicating
the LOAD functionality.
If your goal is to avoid the initial form loading via Ajax, another option
is to use a non-Ajax LOAD with form submission trapped and completed via
Ajax:
LOAD('default', 'myform', ajax_trap=True)
Anthony
On Monday, August 3, 2015 at 12:06:22 AM UTC-4, Samuel Sowah wrote:
>
> First of all I want to know if this is possible because currently all my
> crud forms are submitted via ajax, using the LOAD component, but I am
> wondering if it's possible to submit crud forms via ajax without requiring
> LOAD?
>
> If so, how? and if not, what other ways does web2py implement ajax form
> submission?
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.