Clear values when closing overlay

For use case where we have an overlay for people to use, e.g. key in some data, if the user close the window using the back button or X (close window) … is there a way to reset/clear data user key in?


No, but you can clear the values when the overlay is opened.

1 Like

thanks Darren.

This is partial solution as data is user specific …

I don’t understand why the data being user-specific has something to do with the problem here?

My use case is an event where user can register their interest by indicating the number of seats. This is deducted from maximum seats available. So if a specific user keys in he wants 10 seats and just close the overlay, then the 10 seats are falsely seen as reserved. If user does not come back to the particular event page, then it is stuck there “indefinitely”.

Is there a reason you don’t add that “interest” in another table to confirm that they want to submit that “interest” for you to see?

when they click submit it will transfer to another table … I get what you mean … I can just focus on the confirmed “table” and ignore the ones who add seat without submitting. TQ

Yeah, I mean if you intend it to be a form, then you should only consider what has been submitted. And if it’s a user-specific form, I don’t think you want to deal with the hassle of switching users to see what has been input there.

I thought it would be a good user experience where we can see the seats being reduced as different users key in their intention to attend the event … but if they do not submit then this is the issue we will face. so i thought if we can have an action when user press back button or X overlay, then we have a solution.

Well, to me, a form is a form, only if they submit then you want to consider that.

1 Like

You could still do that, just don’t finalise the count until after they submit.
So you essentially have two counts - a global count that all users see, and a user specific count that each user sees as they are filling in the form. Keep in mind that because it’s user specific, anything that any user does won’t have any impact on what others see until/unless they submit the form.