Which jQuery version?it appears that the snippet is loading the the reference to jQuery correct?
The Hooks are called Formit2AjaxUpload and AjaxUpload2Formit. They are working together with FormIt as hooks (http://rtfm.modx.com/extras/revo/formit/formit.hooks).
What are the TWO hooks and how would you set them?
[[!Formit? ... &preHooks=`db2FormIt, Formit2AjaxUpload` &hooks=`AjaxUpload2Formit, FormIt2db` &ajaxuploadFieldname=`image` &ajaxuploadTarget=`images/user/[[!+modx.user.username]]/` &ajaxuploadUid=`image` &packagename=`userimages` &classname=`userimages` &tablename=`userimages` &where=`{userid:"[[!+modx.user.id]]"}` &autoPackage=`1` ]]
only js error I see now is SyntaxError: Using //@ to indicate source map URL pragmas is deprecated. Use //# instead which is coming from jquery.min.js
Quote from: d1ckyh at Jan 01, 2014, 07:34 PMTHANK YOU!The Hooks are called Formit2AjaxUpload and AjaxUpload2Formit. They are working together with FormIt as hooks (http://rtfm.modx.com/extras/revo/formit/formit.hooks).
What are the TWO hooks and how would you set them?
To save/retreive the user data you could use Formit2db (http://rtfm.modx.com/extras/revo/formit2db). The hooks of that package have to work before/after the AjaxUpload hooks.
Should work like this (untested):
[[!Formit? ... &preHooks=`db2FormIt, Formit2AjaxUpload` &hooks=`AjaxUpload2Formit, FormIt2db` &ajaxuploadFieldname=`image` &ajaxuploadTarget=`images/user/[[!+modx.user.username]]/` &ajaxuploadUid=`image` &packagename=`userimages` &classname=`userimages` &tablename=`userimages` &where=`{userid:"[[!+modx.user.id]]"}` &autoPackage=`1` ]]
This call should save/retrieve the images in a user folder and saves/retreives the data on MODX user id base in a custom table called modx_userimages (or whatever table prefix you use).
&ajaxuploadFieldname=`image` &ajaxuploadTarget=`images/user/[[!+modx.user.username]]/` &ajaxuploadUid=`image`
&packagename=`userimages` &classname=`userimages` &tablename=`userimages` &where=`{userid:"[[!+modx.user.id]]"}` &autoPackage=`1`
Those lines are for AjaxUpload:
&ajaxuploadFieldname=`image` &ajaxuploadTarget=`images/user/[[!+modx.user.username]]/` &ajaxuploadUid=`image`
The formfield is 'image', the folder is an existing (maybe a problem - could be solved but not in this thread) username based subfolder in 'assets/images/user/'
And the next ones for Formit2db:
&packagename=`userimages` &classname=`userimages` &tablename=`userimages` &where=`{userid:"[[!+modx.user.id]]"}` &autoPackage=`1`
The table (and class-/packagename) is defined, the userid is used as where clause to look which db row has to be changed with the filename. The fieldnames in that table should have the same name as the name attribute of the according form fields.