BarnsleyBloke Ah. Modx sanitised my code and obviously removed the bits you need. Good spot. I'll make some adjustments tomorrow.
It can be checked to make sure it doing something. I use Chrome Dev tools mostly.
Press F12 and goto the application tab. On the left hand side the should be session storation. Expand that and there should be an entry in for your site.
When the form is submitted there will be an entry with the JavaScript object.
If nothing is there than it's not done it. You may have an error showing in console.
Ah roger that.
Good tip... I know why the javascript wasn't working now - jQuery is inserted in the footer on my site and so the javascript for the checkbox remembering needs to go below that - above it on my site and the javascript doesn't work.
So I moved your javascript from the FormLister call into my custom.js file (which sits in the footer below the jQuery call) and it is working beautifully. Remembers every time 😀 .
Thanks for the super solution @BarnsleyBloke .
The thing I can't work out now is how to return a comma separated list of checkbox selections in the FormLister report.
Typically I'd use name=chk[]
with square brackets in the row template of the checkbox input and
[+chk.value+] in the FormLister report (Which returns: test 1, test5, test 8 etc).
Given the script needs name="chk-[+id+]"
, I am stumped 😅 .
Any ideas?