So today I tried to set up a cookie on a new page - I wanted to set it up so that it would show a modal 5 times (to be sure a new user digested the additional / important information I had put on the modal). I have a modal now that comes up once (thanks to Teodor). But this one I wanted to come up 5 times. I set everything up so that the cookie would be incriminated by 1 each time the user clicks the close button on the modal.
Much to my surprise when I used +1 operator the cookie value (which I had defaulted to zero) went to 1 on the first click, then 11 on the second click and 111 on the third click. I had set the cookie variable up as a number so this did not makes much sense to me.
Next I looked for a ++ operation I could add - I could not see one (see photo below). Then I tried just using <= 11111. Another big surprise ā now the cooke was showing up as FALSE vice how it behaved above.
Can someone please tell me how to increment a cookie value so I can display it the number of times I would like?
Well you need to use the āto numberā formatter first on the current cookie value, as it is a string. Thatās how strings work with the + operator.
Iām sorry to be so dumb but I cannot figure out where to add the ātoNumberā formatter - I really do try to do this stuff w/o help for hours and hours - been up since ~3 AM working on this. I donāt know what else to do but ask for help after trying and trying. Again, Iām sorry to ask and I do really appreciate all the help you have given me.
and it is working now - when I did it the first time I must have forgotten to clear my old cookie value and I thought it was going up from 1-11-111 etcā¦ But it was not and is working now as expected!
Thank you for all your help and support - Wappler is so powerful that Iām having a hard time learning all of its features but everyday I learn a little more thanks to youā¦