I have a problem to pass &where option to Formit with a variable.
The following code works fine to update record with id=12
[[!FormIt?
&hooks=`spam,FormIt2db,email`
&preHooks=`db2FormIt`
&fieldname=`updt`
&where=`{"id":"12"}`
&packagename=`modx_ctm_passtmag_formit2db`
&tablename=`ctm_passtmag`
&emailTpl=`emailFormitTestTpl`
&emailTo=`[email protected]`
&validate=`nospam:blank`
&autoPackage=`1`
]]
All is Ok, record is updated
But this one doesn't work :
[[!FormIt?
&hooks=`spam,FormIt2db,email`
&preHooks=`db2FormIt`
&fieldname=`updt`
&where=`{"id":"[[getUrlParam? &name=`updt`]]"}`
&packagename=`modx_ctm_passtmag_formit2db`
&tablename=`ctm_passtmag`
&emailTpl=`emailFormitTestTpl`
&emailTo=`[email protected]`
&validate=`nospam:blank`
&autoPackage=`1`
]]
No update, a new record is created !
Any idea?