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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,395)