cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aaroh_bits
Resolver I
Resolver I

Not able to clear a textfield

Hi All. 


I have the following requirement

 

  1. User can select a System from dropdown.

    aaroh_bits_0-1620272199086.png

     



  2. And If Others textfield is disabled  

    aaroh_bits_1-1620272199089.png

     



  3. If user selects Others from System dropdown, then If Others textfield is enabled

    aaroh_bits_2-1620272199091.png

     

  4. User can again change another system from system dropdown and If others field is disabled but still shows test text

aaroh_bits_3-1620272199093.png

 

 

  1. I followed this link https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-clear-a-Text-Input/td-p/3545 

  2. I followed these steps On the screen’s OnVisible property, created a context variable  called locUAReset 

    aaroh_bits_4-1620272199108.png

     

  3. For the If  Others  textfield , set the Reset property to context variable as follows:


    aaroh_bits_5-1620272199112.png

     



  4. And Default property as follows:

    aaroh_bits_6-1620272199114.png

     

     

  5. But I am getting unexpected results:

    Clear Text Field.gif



Please advice how could I clear the If Other textfield when a user selects system a value which is not  Others.

 

@RandyHayes @WarrenBelz @Pstork1 @v-xida-msft @v-xiaochen-msft 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks a lot @WarrenBelz ..I tried your suggestion your way, but I when user a  tab out / move out of the textbox, its clearing the value. I tried some other technique which worked: 

 

  • System Dropdown

    In the system dropdown OnChange function, I reset the If Other  txtIfOtherSystem Textbox which I want to clear 
    If(
    ddlSystemUA.Selected.Value <> 'UA Systems'.Others,
    Reset(txtIfOtherSystemUA),
    false
    )

    aaroh_bits_4-1620304752130.png

     

     

  • txtIfOtherSystem  Textfield

    In the txtIfOtherSystem  DisplayMode Property, used the code

    If( ddlSystemUA.Selected.Value = 'UA Systems'.Others, Edit, Disabled )​

    aaroh_bits_3-1620304723077.png

     

  • I got expected result:

    Working One.gif

View solution in original post

2 REPLIES 2
WarrenBelz
Super User III
Super User III

@aaroh_bits ,

You just simply reset it directly

Reset(TextBoxName)

 

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.

Thanks a lot @WarrenBelz ..I tried your suggestion your way, but I when user a  tab out / move out of the textbox, its clearing the value. I tried some other technique which worked: 

 

  • System Dropdown

    In the system dropdown OnChange function, I reset the If Other  txtIfOtherSystem Textbox which I want to clear 
    If(
    ddlSystemUA.Selected.Value <> 'UA Systems'.Others,
    Reset(txtIfOtherSystemUA),
    false
    )

    aaroh_bits_4-1620304752130.png

     

     

  • txtIfOtherSystem  Textfield

    In the txtIfOtherSystem  DisplayMode Property, used the code

    If( ddlSystemUA.Selected.Value = 'UA Systems'.Others, Edit, Disabled )​

    aaroh_bits_3-1620304723077.png

     

  • I got expected result:

    Working One.gif

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (80,842)