Answer the question
In order to leave comments, you need to log in
What event (hook) can catch sending an AJAX form from a site to Bitrix?
There is a site, it has a callback form that is sent to the backend like this:
function() {
BX.ajax.submitComponentForm(this, 'comp_17d0ec4a88062c4249d63e84f9ffc380', true)
}
Answer the question
In order to leave comments, you need to log in
No way.
That is, you cannot catch sending all forms on the back-end, because each form is in fact not a single request to some address, but a regular POST / GET in an iframe to the same address.
That is, how it works:
1) In JS, you perform a form submission (trigger this function)
2) The function creates an invisible iframe and sets the target of the form to the given iframe
3) This iframe is submitted, and the result that is returned from it is replaced in the form container
The only thing you can do is on JS: it will hang on all forms on the submit event (standard for JS) or on the bitrix onAjaxSuccess (when the form has already been submitted and the result has been received).
Of course, you can catch all GET / POST requests in init.php, but this is already wildness.
PS Edit the component, but do not insert crutches
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question