I'm trying to store form field values to session storage and access them on the thank you page, when form is submitted.
I tried the attached code in Data Elements. But it's not working as expected. Meaning the values do not appear to be in session storage when i check on thank you page.
Data elements are meant for reading/returning values, so you shouldn't be manipulating your session storage values in a data element. Manipulation should be done in Rule actions instead.
Move your code's lines 10-11 into a custom code action inside a relevant Rule.
Change your data element to Core > Session Storage, and specify your sessionStorage key "dc_fname".
Data elements are meant for reading/returning values, so you shouldn't be manipulating your session storage values in a data element. Manipulation should be done in Rule actions instead.
Move your code's lines 10-11 into a custom code action inside a relevant Rule.
Change your data element to Core > Session Storage, and specify your sessionStorage key "dc_fname".