Run JavaScript after a form has been submitted
Content
I have a widget. Within that widget I have several forms like the one shown in the code below.
What I want is after the form has been submitted successfully, to close the modal and clear the input values
I've tried subscribing to evt_formButtonSubmitResponse but it doesn't seem to work. Subscribing to evt_formButtonSubmitRequest does but it's only when the form is submitted rather than after a successful submission
Any guidance? I have a feeling I'll need to do a custom submit widget but I'd rather not!
Code Snippet
<form id="rn_QuestionSubmitRestrictions" method="post" action="/ci/ajaxRequest/sendForm"> <div id="rn_ErrorLocation"></div> <br> <div style="display : none"> <rn:widget path="input/ProductCategoryInput" name="Incident.Product" default_value="8"/> <rn:widget path="input/ProductCategoryInput" name="Incident.Category" default_value="360"/> <rn:widget path="input/FormInput" name="Incident.Subject" default_value = "My Details - My Restrictions"/> </div> <div class="form-group"> <rn:widget path="input/FormInput" required="true" name="Incident.CustomFields.c.type_of_enquiry" label_input="#rn:msg:CUSTOM_MSG_TITLE_REQUEST#" /> </div> <div class="form-group"> <rn:widget path="input/FormInput" name="Incident.CustomFields.c.details_of_enquiry" required="true" label_input="#rn:msg:CUSTOM_MSG_DETAIL_ENQUIRY#" /> </div> <rn:widget path="input/FormSubmit" label_button="#rn:msg:CONTINUE_ELLIPSIS_CMD#" on_success_url="none" label_on_success_banner="Request successfully submitted" error_location="rn_ErrorLocation"/> </form>
1