Thanks @milindmore22 for the pointers.
We were able to solve this by using the information and ideas from a few other places.
For anyone facing the same issue, here is what we have done.
We have added methods to the amp-form events using the “on” attribute. We attached the following methods to the “submit-success” event
- Close the lightbox using the .close method on the lightbox
- Clear the content of the form using the .clear method on the form
- Redirect to a new page using the .navigateTo method on the AMP object
Here is the code that we have implemented.
<form id='contact-form' method="POST" on="submit-success:contact-form-popup.close,simple-contact.clear,AMP.navigateTo(url='/confirmation')">