cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lliu_western
Resolver II
Resolver II

A button that enable input box

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. 

3 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User III
Super User III

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

View solution in original post

DevendraSingh
Resolver I
Resolver I

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

View solution in original post

lliu_western
Resolver II
Resolver II

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. 

View solution in original post

4 REPLIES 4
mdevaney
Super User III
Super User III

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

View solution in original post

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.

DevendraSingh
Resolver I
Resolver I

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

View solution in original post

lliu_western
Resolver II
Resolver II

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. 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (929)