cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pnass001
Post Patron
Post Patron

How to make a dropdown required to be filed out before submitting a form

I am trying to make these fields attached below all required before submitting a form (The Submit button will not be clickable). It works for text inputs but with the dropdowns I'm doing something wrong. How can I make a choice within the dropdown blank to work with this code, other than including "" in the items field because that didn't work for me. 

 

The Displaymode for my Submit button:

If( (IsBlank(StandardEndorserName1E.Text)) || (IsBlank(DesignNumberE.Text))|| (IsBlank(DepartmentE.AccessibleLabel))|| (IsBlank(ModuleE.AccessibleLabel)), DisplayMode.Disabled, DisplayMode.Edit )

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@pnass001 
See my code below.  You'll want to refer to the Selected property with the your column name.  Many times this is just Dropdown.Selected.Value.  

 

If(
    IsBlank(StandardEndorserName1E.Text
    || IsBlank(DesignNumberE.Text)
    || IsBlank(DepartmentE.AccessibleLabel)
    || IsBlank(ModuleE.AccessibleLabel)
    || IsBlank(Dropdown.Selected.Column_Name),
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

---
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

5 REPLIES 5
mdevaney
Super User
Super User

@pnass001 
See my code below.  You'll want to refer to the Selected property with the your column name.  Many times this is just Dropdown.Selected.Value.  

 

If(
    IsBlank(StandardEndorserName1E.Text
    || IsBlank(DesignNumberE.Text)
    || IsBlank(DepartmentE.AccessibleLabel)
    || IsBlank(ModuleE.AccessibleLabel)
    || IsBlank(Dropdown.Selected.Column_Name),
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

---
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."

@mdevaney  Ok done, but what happens if they don't fill in the text inputs and drop downs? I want the Submit Button to not be able to be clicked on. What can I do to rework the code I posted above to make the button's displaymode enabled only if all fields have been filled out

@pnass001 
OK.  I thought you had already worked out the rest.  I'm kind of confused about your references to the accessible label.  Here's the generic code you could write for the 4 required fields

 

If(
    IsBlank(TextInput_StdEndorsersName.Text)
    || IsBlank(DepartmentE.Selected.Value)
    || IsBlank(ModuleE.Selected.Value)
    || IsBlank(DesignNumberE.Text),
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

---
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."

@mdevaney It works! Thanks. Forget my previous reply. Was in regards to another comment.

@pnass001 

I’m glad you let me know, I was confused lol!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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