How to get which input element is focused to display error message in advance?

I want to show an error message when a user moves to a different input element without filling in a specific input. (like in image below, “Your phone number format is invalid” message displays when I move on to another input element)

Error message can’t be displayed when a user does not select any form.
So how can I get to know which element is focused?

Thanks in advance!

Hi @Jay12 :wave:

On the input component, you have the event on blur, which triggers when the user unfocuses the input.
CleanShot 2024-07-19 at 07.13.47
When it’s happening, you can then check the content of the input

Ohh thank you so much! You saved my day
I will give it a try!

1 Like