Make checkbox disabled for a short time

I’m creating a thing when a checkbox within a repeating group is clicked… this has a cetain workflow… when the checkbox is checked, the thing is created, when it is unchecked, the thing is found (through a do a search for…) and removed. For this reason i dont want the user to click the checkbox in quick succession - if they do it messes this process up because theres no time to do it properly… in a sense i want to disable it for a small time period (say 2 seconds)… Ive attempted this by defining a state ‘lastClicked’ that saves the current date/time into it:

image

then… in my checkbox i used the following conditional statement…

image

However, results are not as expected. I’ve produced a demo app to highlight this problem… Any ideas?

The example is here: https://bubble.io/page?name=index&id=disable-checkbox&tab=tabs-1

P.S. some may suggest to not create a thing upon checking the checkbox - i have been exploring many options and this was the only viable one since you cant save an entire repeating group with one button click.

I’m going to be the guy that ignores your last sentence and say, “I wouldn’t recommend using checkboxes this way.”

What’s your use case about the repeating group? If you walk us through what you’re trying to do, we can probably come up with a better solution that makes more sense.

The disclaimer was because there’s always someone like you to suggest what you suggested :stuck_out_tongue:
never the less I am all ears!

Im making a car rental system… when someone puts in a car rental request with date and time etc, all of the available renters (people with cars_) are informed and directed to a page. That page shows a repeating group with all of cars that are registered with that particular renter. They proceed to ‘check’ which cars they would like to offer and fill in the price in an input box. In my current design, when they check that box, an ‘offer’ thing is made with those details. There is a save button at the bottom, ideally all the items would be created out of that repeating group once save is pressed; rather than my current approach. I think bubble could really use some functionality in terms of that. no real way to loop through a repeating group and create things based on each entry.

With my current approach, the main problem was that the repeating group wasn’t responsive enough regarding creating and then finding / deleting the offer item. I have found a workaround which is to create a ‘loading’ button infront of everything to stop people clicking prematurely. Later hide it using ‘do every 0,5 seconds & Page loaded after fold’ like so:
image

You’d use an API workflow for this. You can schedule the API workflow to run on all the objects in that list, and it’ll happen behind the scenes so users can still poke around and work on the site. In that API workflow, you would have the activity as you’re currently using for the checkbox logic.

Interesting Andrew… Upon your suggestion I have just discovered the API workflow section… could you elaborate a bit on how to use it in this case? I had a brief look… my ‘offer’ thing has several fields such as ‘car’ (which come from the repeating group cell) and ‘rentRequest’ which comes from the page itself… would it be possible to pass these two things into the API workflow? [or would I have to make an object containing these things and pass that instead?]

This topic was automatically closed after 70 days. New replies are no longer allowed.