cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mjgenesis
Frequent Visitor

Submit button not enabling

My Submit button has the following setting for the DisplayMode property requiring there to be no errors with the form to work. 

 

If(Form1.Valid && IsBlank(lblErrorMessage.Text),DisplayMode.Edit,DisplayMode.Disabled)

 

I have created a Label (lblErrorMessage) with the following formula for the TEXT value to display an error message if the email addresses are not formatted correctly in their respective input fields.  However, when I run/test the form my Submit button remains grayed out as if there is some text still inside lblErrorMessage.

 

If(And(Not(IsMatch(inpBillEmail.Text, Match.Email)),Not(IsBlank(inpBillEmail))), "-Please verify your Billing email address is correct") & Char(13) & Char(10) &
If(And(Not(IsMatch(inpContactEmail.Text, Match.Email)),Not(IsBlank(inpContactEmail))), "-Please verify your Contact email address is correct") & Char(13) & Char(10) &
If(And(Not(IsMatch(inpContact2Email.Text, Match.Email)),Not(IsBlank(inpContact2Email))), "-Please verify your Contact 2 email address is correct")

 

Consequently, if I add the following to the end ( & Char(13) & Char(10) &)  my Submit is available, but my formula will have errors expecting an operand and with an invalid argument type.

 

I would like the button to remain disabled until there are no errors on the form and all email input fields are formatted properly.  I am new to Powerapps, so I'm hoping this is some easy newbie blunder. Thanks in advance!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

The label may not be showing text but it still has the Char(13) & Char(10) values in it. Try using trim in your conditions test to remove the extra characters. See example below:

 

If(Form1.Valid && IsBlank(Trim(lblErrorMessage.Text)),DisplayMode.Edit,DisplayMode.Disabled)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Jeff_Thorpe
Super User
Super User

The label may not be showing text but it still has the Char(13) & Char(10) values in it. Try using trim in your conditions test to remove the extra characters. See example below:

 

If(Form1.Valid && IsBlank(Trim(lblErrorMessage.Text)),DisplayMode.Edit,DisplayMode.Disabled)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

It worked.  Thank you very much.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (5,242)