This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Luis Escobar
Posted Aug 24 - Read on Facebook

Hi All! Does anyone know how to trigger an event based on a certain number of characters entered into an input?

For example, say I wanted to mimic Framer's Access Code input - once 6 digits are entered, the input is no longer focussed and the project loads. An example would be really helpful as well. Thanks!

2 Comments

Ian McClure

There is a property change event. It will fire every time you change the string but it should do it.

Layer.on "change:html", ->
If Layer.html.length > 6
//Do stuff

Luis Escobar

Awesome, thanks! I can't seem to call the input within the class I created, though. Do you think you could help me with that?

I thought this might work:
emailField.children[0].on "change:html", ->
if emailField.html.length > 6

but it didn't.

Here's the class I created:
https://framer.cloud/tBJkY

Don't mind how wonky it looks in the sim - it actually looks right on my device.

Read the entire post on Facebook