is it possible to reset form via javascript?
-
Hi. This is outside of the normal functionality for this plugin, but I’m hoping you can suggest something.
The situation:
I have a page with a carousel, which displays data iterated from a 3rd party api using an ajax call. On the same template, I have a VFB form. I wrote some javascript to update one of the text fields’ value with data from the ajax request as the user advances the carousel.
To inquire about a slide in the carousel, the user clicks a button which opens the VFB form in a modal, containing the pre-populated field.
After the user submits the form, the confirmation message appears. Then the user can click out of the modal. The entry contains the data from the ajax request. All good so far.
If the user then selects another item in the carousel and decides to inquire about it, they open the modal again, but the confirmation message is still present.
I’d like to be able to reset the form from within a js callback function, after the modal closes, without forcing a full page refresh. Any suggestions? Is this possible?
Thanks
- The topic ‘is it possible to reset form via javascript?’ is closed to new replies.