It may be easier to use a JavaScript Action as you can call these from Nanoflows. They allow you work with custom JavaScript directly in your app.
For example, if someone selects a radio button, you can trigger an on-change event to call a nanoflow, which in turn can call the JavaScript action. You can then set the cookie in the JavaScript action.
https://docs.mendix.com/howto/extensibility/build-javascript-actions/
I hope this helps, good luck
I finally got it to work!
The solution involved two parts: an HTML snippet (Content-Type: HTML) and a JavaScript snippet (Content-Type: JS). Here’s what I did:
/theme/
folder.As a result, the HTML snippet remains essentially empty, with the content type set to JS, and it references the JS file in the /theme/
folder.
That did the trick. Thanks for your help, everyone!