On paste event?

Hi guys. Is there any JS, plugin or way to get the data when an user paste something in one of the inputs in the screen?

The issue is that I have those 6 inputs for 2fa limited to 1 character and some users are trying to paste the whole code in the first input. I want to grab the data they paste on it, so I can put it in the parent group where all inputs grab their respective character (Already do this if the user clicks the SMS link).

*¹ I’m aware we can force the paste, but that asks the user for permission and I’m trying to avoid that as users a bit older and I also wouldn’t know when they would have the correct code on the clipboard.

² tried buying a plugin that is supposed to do this, but Bubble has been funny on buying plugins for a few months now (image below).

Have you tried my OTP Input plugin? Handles that for you.

2 Likes

This is looking great, @GH5T ! Reaaally close to what I need here.

Unfortunately, I need to be able to set an initial value (we send an optional link in the OTP message to the phone/email). Also it would be cool if we were able to change the height of the input boxes.

*Btw, I tried buying your plugin but it installed directly and I have access to your code. I see you had this discussion before, but just letting you know, I would gladly buy it.

In my use case, I’m not using the validation on the front, but the behavior of your inputs looks way better than my 10 conditions to do similar things (and don’t do it as smoothly nor have the paste option)

Thank you, appreciate it.

The validation can happen in the back-end. I built the plugin to handle that.

You just need to set the state of the item after you retrieve it. The state of the item wont show up on the front-end.

The example just demonstrates front-end for simplicity.

As for the height, I made it so you can easily adjust the input with custom CSS. Just open your browser tools to see the ID’s assigned to it. I believe I added some info about that in the documentation (within properties).

The plugin is free!


I’ll make it more versatile later when I got some time!

2 Likes

thanks again @GH5T . I’ll checkout and review all your other plugins later. Seems other devs are being a pain there for no reason.

This one particularly is still having that bug from bubble showing is paid but its free indeed :stuck_out_tongue: But anyways keep it up and thank you again!