cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ag12
Helper I
Helper I

Not allow Submission until all fields are filled.

Hello Community,

 

I am trying to disable my submit button until the user fills all fields.  The first field is a toggle, when the value is false the user uses a combobox to select a reason for false. When the toggle is true we want to allow the submit button to be used without selecting an item in the combobox.  We tried this code but the submit button is still showing and operating with empty fields.  

 

If(IsEmpty(ComboBox1.SelectedItems) And Toggle1.Value = false, DisplayMode.Disabled,DisplayMode.Edit)

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@ag12 

Like this...

 

If(
    Toggle1.Value Or (!Toggle1.Value And IsEmpty(ComboBox1.SelectedItems)),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@ag12 

Like this...

 

If(
    Toggle1.Value Or (!Toggle1.Value And IsEmpty(ComboBox1.SelectedItems)),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thank you for your help, but the code may be missing something. The comma following the isempty function states that there is a parenclose where the comma is expected.

 

@ag12 
I missed a closing bracket.  Please take a look at my corrected code above.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thanks a million! You are great

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,582)