Restrict user by entering extra characters except number

Hi everyone,
Hope you all are doing good.

It’s been a week I have been stuck in a problem and the problem is that I have a input of Integer type. It is working properly but I want when a user type extra characters except number the input then value get reset and show a toast saying “Please enter a valid value”.

I am sharing a clip, so it will be easy for you to understand the problem.

Please give it a look @mikeloc @adamhholmes

Thank you in advance

I’m not sure I understand…

I have a input of Number type.

If your input is a Number type (integer/decimal/currency/percentage), or even Text(numbers only) then it’s impossible for a user to enter any non-numerical character.

By the looks of it, your input is actually a Text input…

Is that intentional? (why would you want to allow users to enter non-numerical characters it the input value must be a number?). Why not just restrict the input to numerical characters only?

Input is of Integer Type

Ah… well that’s news to me… (it seems you can enter non-numerical characters into a number input… I always thought that was restricted.)

I’m not sure there’s any vanilla Bubble way to achieve what you want, but here’s a way using some simple JavaScript that seems to to the job:

Reset Non-Numerical input (bubbleapps.io)

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