How can you clear text input fields after you submit the data? After I press submit it reloads the same page with values in the text boxes.
Solved! Go to Solution.
In your case you will need to use a different variable for each text box you have.
So for the ones you have screenshot you will have defaultClock and defaultAddress (for example). They will be set on the OnChange property of the DriverName drop down. So your OnChange will change to:
UpdateContext({Driver: LookUp(DriverInfo, Dropdown8.Selected.Name exactin Name), defaultClock: Driver.Clock, defaultAddress: Driver.Address})
And then the Default property on the text boxes will be defaultClock for the Clock text box and defaultAddress for the Address text box.
Then on the Save button you will only add:
UpdateContext({defaultClock:"", defaultAddress: ""})
- they will then change to the coresponding ones when the driver is selected from the drop down.
You don't need to set any OnVisible property of the screen.
Hope this makes more sense 🙂
On drop down you should use the Reset property to reset their values. So instead of assigning a variable to the Default property, set the Reset property to be buttonName.Pressed - where buttonName is the name of your 'New Entry' button.
Hope this helps 🙂
I have the same problem with a drop down menu. The option for reset is "true" and I put a default value. However, if I select an item in the box, I validate the form then I come back on the page, I still have the same item selected in the drop down menu.
Can someone from Microsoft give a solution or correct the issue ?
Hi @tbrantley,
In order to clear the text boxes you need to use context variables.
You will need to set your Default property of the TextBox to be a variable, for example resetControls. Then on the OnSelect propert of the submit button add the UpdateContext({resetControls: ""}) after the submit function.
Or you can set the OnVisible property of the page to be UpdateContext({resetControls: ""}) - this will reset the controls everytime that page is made visible.
Hope this helps 🙂
Well if you want to put the default value back in the text box instead of the value that has been input by the user then on the OnSubmit property, after the Submit function, change the UpdateContext to UpdateContext({resetControls: Driver.Clock}).
You will still use the resetControls as the value of the Default propert, and will set it on the OnVisible property of the screen using UpdateContext({resetControls: Driver.Clock}) - so that it will be set before you submit the form.
In your case you will need to use a different variable for each text box you have.
So for the ones you have screenshot you will have defaultClock and defaultAddress (for example). They will be set on the OnChange property of the DriverName drop down. So your OnChange will change to:
UpdateContext({Driver: LookUp(DriverInfo, Dropdown8.Selected.Name exactin Name), defaultClock: Driver.Clock, defaultAddress: Driver.Address})
And then the Default property on the text boxes will be defaultClock for the Clock text box and defaultAddress for the Address text box.
Then on the Save button you will only add:
UpdateContext({defaultClock:"", defaultAddress: ""})
- they will then change to the coresponding ones when the driver is selected from the drop down.
You don't need to set any OnVisible property of the screen.
Hope this makes more sense 🙂
Hey I'm trying to make the default value of these drop down boxes "00" when "New Entry" is clicked. For some reason it doesn't clear them after the first click but clears the drop downs after the second click. Can anyone help?
New Entry OnSelect property
DropDown3 default property
On drop down you should use the Reset property to reset their values. So instead of assigning a variable to the Default property, set the Reset property to be buttonName.Pressed - where buttonName is the name of your 'New Entry' button.
Hope this helps 🙂
@alexdec Were you able to accomplish this? Currently stucked in this step. Sounded so simple yet... 😞 OY!
User | Count |
---|---|
137 | |
136 | |
78 | |
73 | |
69 |
User | Count |
---|---|
222 | |
137 | |
78 | |
60 | |
56 |