I have created a form in which I am updating the status flag to inactive. I have a constraint that per day only 200 status can be changed to inactive. I want to display a progress bar or a text field which updates the value from 1-200 per update.
Can you help me achieve this?
I tried few things but I am new to javascript hence struggling
Can you share more information? A screenshot? Off the top of my head, you would need to store the number of clicks somewhere and count them every time a "click" takes place and that could be a lot of processing/overhead....
I want to display and show the number of clicks when a user clicks my action button "Click to Redeem". I want to set a threshold of 200 so when the count reaches 200 the user stops redeeming coupons for that day
OK so every time the coupon is redeemed you're going to have to add that coupon value, redeemed set to true, date of redeem, and the userid to another table where you can keep track of it so that you can count the number of redeem actions that took place each time the redeem action is completed....
User clicks the action button "Click to Reddeem"
Store the information in a table once the redemption has taken place
Run a query to count the number of redemptions
(You will have to disable the action button as the redemption isFetching or the query tracking the redemption count, etc. isFetching)
Disable the action button when count has reached 200
Thank you for your response. I also wanted to know is there a way where we can directly get the count of clicks either by clicking on "Click to Redeem" or by using the form "Validate" button?
Can we create a javascript query in which for each time update query is being run a counter gets initialized to get the count of runs the query has made?
Maybe you could, but if the user closes the app and then comes back later in the day, you still need to keep track of the user's clicks...you could use localStorage but you would have to reset the value every day. By storing the update (redemption information and count for each user by date in a db table you will also have a history if the user is coming back multiple days in a row) You can also integrate with some metrics SaaS platforms as well like Google Analytics or DataDog.