I am trying to run some javascript functions after a form submit using AJAX. (eg to dynamically update some other parts of the page), using the parameters retrned from ajaxcomplete:
jQuery(document).ajaxComplete(function (event, xhr, settings)
1. How do I detect/identify the events from the AjaxComplete callback parameters to make sure that this is the correct callback corresponding to the specific form submission?
2. Also is there any way to include some additional information from the server in the callback values that i can then use in my custom js
I recall there was some documentation on this a few years ago, but I cannot find it.
Hello. Thank you for contacting the Toolset support.
There is not much information available but as soon as you click on the "Frontend events" button you will see a popup where you can add the desired ajax hooks like:
- js_event_wpv_pagination_completed
- js_event_wpv_parametric_search_results_updated
Please check following links that may help you:
- hidden link
- hidden link
That's not quite what i was looking for. It seems your suggestions relates to search /query. I think the front end events option only shows for those types of templates.
I was more looking for any information related to Form submissions using ajax, where it may be necessary to update the page after the form is submitted. (eg to refresh a view or post information elsewhere on the page, after the form is submitted).
Do you mean, you are using a Toolset Form and when user submit the form you want to update the specific information that is displyed on different area of the same page? if yes:
There is no such hook available to use but there are hooks that fires after you submit the button so that you can update the things on database and alter you can use the Toolset form hook "cred_success_redirect" in order to redirect user to different page where you can display that information.
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect