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

Disabling submit button

Okay, so I have just had an idea but I have no idea how to execute.

 

I have a submit button on my form that has a patch() function as I am patching a person/group to a Sharepoint List which Submit() won't do.

 

My idea is, is to have the "Save" button disabled until the required fields are filled in. Does anyone have any ideas on how to do this?

 

Thanks!!

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @amydixanne

One way to do this is to set the DisplayMode property of your button like so:

 

If(IsBlank(FirstnameTextbox.Text) || IsBlank(SurnameTextbox.Text),
   DisplayMode.Disabled,
   DisplayMode.Edit
)

In this example, a user would need to enter text into the Firstname and Surname textboxes to enable the button.

 

 

View solution in original post

5 REPLIES 5
timl
Super User
Super User

Hi @amydixanne

One way to do this is to set the DisplayMode property of your button like so:

 

If(IsBlank(FirstnameTextbox.Text) || IsBlank(SurnameTextbox.Text),
   DisplayMode.Disabled,
   DisplayMode.Edit
)

In this example, a user would need to enter text into the Firstname and Surname textboxes to enable the button.

 

 

thank you, that works brilliantly!!! 

jimbobuk
Regular Visitor

Might be a little late but for those who find this post, there is an easier way!

@amydixanne in case you are interested, 

Set submit button 'Display mode' to

If(formName.Valid,DisplayMode.Edit,Disabled)

 

Thank u so much!

jebalert
Microsoft
Microsoft

On the DisplayMode property of the submit button you could do the following:

 

 

If(!IsBlank(DataCardValue1.Selected.Value) && !IsBlank(DataCardValue2.Selected.Value) && !IsBlank(DataCardValue3.Selected.Value),DisplayMode.Edit,DisplayMode.Disabled)

 

 

 

Note that the above works for required dropdowns. If you had the need for three dropdowns to be populated and one text field it would look like this (note the DataCardValue4 to identify the differences).

 

 

 

If(!IsBlank(DataCardValue1.Selected.Value) && !IsBlank(DataCardValue2.Selected.Value) && !IsBlank(DataCardValue3.Selected.Value) && !IsBlank(DataCardValue4.Text),DisplayMode.Edit,DisplayMode.Disabled)

 

 

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 (4,498)