How to trigger the Text Entry box without waiting for it to lose focus?

Sep 27, 2022

Hello!

I am creating a simulation in which I have to simulate a search form where a slide layer is displayed as soon as the user enters the 5 digit zip code. Is it possible to trigger the text entry box without waiting for it to loose focus? I have looked at different threads about similar scenarios where the experts have used JavaScript. Unfortunately, I am completely novice to JavaScript. 

So here are my questions:

  1. How can I limit the maximum number of characters in the Text Entry box to 5 digits only?
  2. How to make a slide layer (or even the next slide) appear as soon as the 5th digit is entered in the zip code text entry box and how can I reverse it if the user deletes a digit or two?

Any help would be greatly appreciated. 

Thanks!

Be the first to reply