Ajax form submission

Hi There


Is it possible to complete and submit a custom form using the Javascript API



That is, the form is created and does all kinds of nifty behaviour using jquery and jquery validation, can I submit it via Ajax, or do I need to do (the default) full HTTP post?



Checking in the Matrix Web Services Manual (3.V26p), it appears as though I can access/create/modify Matrix core elements, create pages and stuff. But it does not seem to have a section on submitting a custom form.



Have I missed an important section, or is this the case?



Thanks

Ian

Hi Ian


There are a number of different things that you can get the form to do on the submission actions screen of the form contents asset



http://manuals.matrix.squizsuite.net/custom-form/chapters/form-contents/#submission_actions_screen



Dave

[quote]
Is it possible to complete and submit a custom form using the Javascript API

[/quote]



no, you need to do a proper POST with the form params to the form asset for it to submit properly.



If you want to set up a light-weight submit setup (and I can certainly understand why, non-cached assets can be very slow) you could set the design on the form asset to a blank one, nest it in a page with your normal design applied (and your script etc. included) so it renders all pretty (and more importantly, caches) then POST the results to the form asset from there with ajax (the jquery form plugin isn’t too bad) - that way matrix won’t have to do much work serving a page back to you. I’m pretty sure that’ll work anyway. I’m yet to actually set something up exactly like that, but I’ve done similar things before.

Thanks for your answers.


I'll choose to defer implementing it for now, as I've pretty much completed the form in Matrix, and don't have the time (ATM) to reproduce it and test the form submission. Now I know where the solution lay, I may come back to it.



thanks

Ian