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 / A button that enable i...
Power Apps
Answered

A button that enable input box

(0) ShareShare
ReportReport
Posted on by 289

Hello community,

 

I have a question. I have a button, and when a user select the button, I want it to enable the input text box next to it.

 

So by default, the input text box will be disable and can only be enable when button next to it is clicked.

 

I tried a function on the button: OnSelect: Q_TextInput.DisplayMode.Edit     

 

but it doesn't work. Any help is appreciated, thank you. 

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @lliu_western 

    Use a toggle instead of a button.  Then put this code in the DisplayMode of the Text Input

    If(Toggle1.Value=true, 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."

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    For a button to work, you can use UpdateContext({enablebox:DisplayMode.Edit}) in its OnSelect property and in the TextInput box put its DisplayMode property as enablebox.  You would put UpdateContext({enablebox:DisplayMode.Disabled}) in the OnVisible property of the screen.  That would set the default display mode of the TextInput to disabled.

    Given that I think @mdevaney 's idea is better.

  • Verified answer
    DevendraSingh Profile Picture
    144 on at

    Hi,

    You can use variables for this. Following are the steps,

    • Step1: Add formula Set(buttonClicked, false) to "OnVisible" property of screen
    • Step2: Add formula If(buttonClicked, DisplayMode.Edit, DisplayMode.Disabled) to "DisplayMode" property of text box control
    • Step3: Add formula Set(buttonClicked, true) to "OnSelect" property of button control

    Please click Accept as Solution, if this solution solved your issue. If this post was useful, please consider giving it Thumbs Up.


    Thanks & Regards,

    Devendra Singh

  • Verified answer
    lliu_western Profile Picture
    289 on at

    I found another way.

     

    First, I added a toggle just like the previous answer mentioned and set the input text display mode with the function: If(Toggle1.Value=true, DisplayMode.Edit, DisplayMode.Disabled)

     

    Then with the button, I have a function of Onselect: Set(setToggle1,true)

     

    And in the Toggle1 defult: setToggle1         (setting up the variable here) 

     

    Have the Toggle1 visable to be false then it acts like the button is enabling the input text. 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard