web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Disable Submit button ...
Power Apps
Answered

Disable Submit button until all radio button options in a gallery are selected

(0) ShareShare
ReportReport
Posted on by 291

Hi,

I am putting together an audit app. I want to make sure that all the questions are answered before the audit can be submitted. I have the questions in a gallery and am trying to use a ForAll and IsBlank function in the DisplayMode setting of the SUBMIT button. But, I keep getting an error regarding an expected enum value:

auditapp.png

Can anyone help, please? 

Note that the radio button options are just 'Yes' and 'No'. The extra text after no is just a label. I have tried:

ForAll(HSAuditGallery1.AllItems,If(((Radio1.Selected.Value="Yes") Or (Radio1.Selected.Value="No")),DisplayMode.Edit,DisplayMode.Disabled))

but that doesn't work either.

Thanks,

Izzy.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,949 Most Valuable Professional on at

    Hi @IzzyWizz ,
    You can't use a ForAll like that in a static property like DisplayMode - try this

    If(
     "||" in Concat(
     HSAuditGallery.AllItems,
     Radio1.Selected.Value & "|"
     ),
     Disabled,
     Edit
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • IzzyWizz Profile Picture
    291 on at

    Hi @WarrenBelz ,

    Perfect, thanks.

    Izzy.

  • IzzyWizz Profile Picture
    291 on at

    Hi @WarrenBelz ,

    I am trying to understand and apply your code to a second gallery where I have a text input control in each data card and I want the submit button to be disabled until there are values greater than 0 in the text input control for all items of the gallery (I have set the default as 0 as the result box uses If statements based on the value).

    wateraudit.png

    As I understand it, your code says, if there is a || when you join together all of the Radio1.Selected.Values and | for all the items in the HSAudit Gallery, the button is disabled, if not it is useable (in edit mode). But, what is the || and | and how do they relate to whether the Radio1 button is selected or not? 

    Perhaps this should be a new question but I thought it might be useful if you are looking up the question above?

    Thanks,

    Izzy.

  • WarrenBelz Profile Picture
    155,949 Most Valuable Professional on at

    Hi @IzzyWizz ,

    You can use any separator you want : and :: would do the same job.

    What I have done is use them in a Concat statement to put them between the values, so if there are two in a row ||, there must be a blank value in the set.

  • IzzyWizz Profile Picture
    291 on at

    Hi @WarrenBelz ,

    Oh I see! The "|" doesn't have any special meaning, the "&" just puts one in between each radio button answer and if you get two in a row (the "||" with 'in' looks for two together) that is where there wasn't an answer. I have now used it for my second scenario, adding a 0 between each item and looking for 00. Thanks for explaining.

    Izzy.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard