cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoseC12 Helper V
Helper V

Validation on clicking button || Lenght of text input

Good afternoon everyone,

I have an issue about my "Crear" button: I want it to be able to click if the "ID FISCAL" text input is with only 11 characters, no more or less.

Thank you,

Jose

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Validation on clicking button

Simply add this to the DisplayMode property of your button:

If(Len("ID Fiscal".Text) =11, DisplayMode.Edit)

You can combine this with the rest of the logic for the DisplayMode of that button if you like.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Eelman Resident Rockstar
Resident Rockstar

Re: Validation on clicking button

@JoseC12 

Add this to your formula

 

|| !(Len(Input_IDFiscal.Text)=11) ...

 

EDIT: @PowerAddict  typing at the same time 🙂

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Validation on clicking button

Simply add this to the DisplayMode property of your button:

If(Len("ID Fiscal".Text) =11, DisplayMode.Edit)

You can combine this with the rest of the logic for the DisplayMode of that button if you like.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Eelman Resident Rockstar
Resident Rockstar

Re: Validation on clicking button

@JoseC12 

Add this to your formula

 

|| !(Len(Input_IDFiscal.Text)=11) ...

 

EDIT: @PowerAddict  typing at the same time 🙂

View solution in original post

JoseC12 Helper V
Helper V

Re: Validation on clicking button

Thank you to solve me that problem.

Can I also validate to not click the submit button if the "ID FISCAL" text input does not start with "20" for example?

Eelman Resident Rockstar
Resident Rockstar

Re: Validation on clicking button

@JoseC12 

You can utilise the StartsWith() function to help here, like this

 

!(StartsWith(Input_IDFiscal.Text, "20")), Disabled, Edit

 

see here https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-startswith

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,244)