Reset Form Field Data / Remove Unused getOption() Data
-
I’m missing a fundamental concept from the Create a Form tutorial:
All the form fields in the tutorial are static. Once you set them, they stay that way until the user manually changes them. This makes for a great “settings” form, but I need a form that allows the user to input some data for a query, and then reset the fields back to their blank state so the form can be used for another query.
Specifically, I’m trying to do this:
1. Dropdown field for “order_id”
2. User selects order_id and hits submit
3. If order_id has a value, get some data about the order and display it in a “text_area”
4. User validates information by clicking a second submit button (different field name)
5. Form data is clearedAll the fields are defined within the “load_{page_name}” function, as shown in the tutorial.
Everything works except step 5, because I can’t figure out how to clear the form data! Once a given field is set, it remains set every time you reload the page; the form re-populates itself with all the data from the previous Submit.
The topic ‘Reset Form Field Data / Remove Unused getOption() Data’ is closed to new replies.