What is the best / correct method to clear the fields in a form to prepare it for the next use?
I have a simple form on a page. fill the form. submit. Record gets added to the underlying table. good.
now I want to clear the form without navigating away from this page.
simple, I'm sure but could use some guidance.
thanks in advance
michael
Are you using a Form or a TemplateForm component?
Either would do. I can use either form or form template.
I tried both.
Setting the Data
of of a Form to a property which is an empty object {}
will clear it. If using a TemplateForm you can set the Value property of all input components to empty values. Say if a TextBox's Value is set to ${data.FirstName}
you can set data
to {}
via Set property action.
OK. that was easy.
As always thanks for your quick response.
What I did...
- create a page property with set property newRecord = {}
- 'bound' my form data property to ${newRecord}
- to Clear the form I set property ${newRecord} = {}
michael