I’m trying to make a text field act as a counter, and update whenever people press a “Submit” button. The counter works, but the user has to refresh the page to update the counter, which isn’t very intuitive.
I have a text field that counts the number of fields in a dataset and reflects them as a counter. (Shown as “32” below).
The number of fields in said dataset indicate how many people have submitted their email address to us.
Hi J.D., the code I posted doesn’t update live, only upon manual refresh.
So if the user submits their email address, they won’t see the number go from 32 → 33 unless they refresh the page. I’m looking for a way to make that happen automatically.
Currently you have the code only being run at the same time as the page loads itself and so you will need to refresh the page to get this code to rerun itself.
If you want to refresh it when they do the submit, then you can look at adding the refresh to the submit function in your code.