Disable button if regex does not pass

Hello!!

Is it possible to disable a button if the regex for a text input does not pass?

Thank you!

Hey @Miotx,

Yes you can :slight_smile: I assume you need this in combination with your previous question.

If a validation for an input fails, the invalid property is set to true. Use this property to enable/disable your buttons:

{{textInput2.invalid}}
1 Like

Worked like a charm!! Thanks @minijohn

1 Like

Is it possible to disable by 2 conditions? for example I want the button to be disabled if "{{textInput2.invalid}}" just like you wrote which worked great but I also want it disabled if "{{textInput1.invalid}}" as well. How do I combine them I guess?

Thanks again @minijohn

Of course :))

you can use the double pipe operator

{{ textInput1.invalid ||  textInput2.invalid }}
1 Like

Awesome!! You rock @minijohn :sunglasses:

1 Like