Answer the question
In order to leave comments, you need to log in
How to reinitialize JS after submitting ajax form?
Good day to all!)
There is a pop-up feedback form on the site. It is in a component with "AJAX_MODE" => "Y". After sending it, the JS code in it stops working (For example, the form does not close, formatting in the fill fields does not work). Please tell me how can I fix this?
Answer the question
In order to leave comments, you need to log in
Another option is to add this code to the footer
<script>
BX.addCustomEvent('onAjaxSuccess', function(){
let event = new Event("DOMContentLoaded");
document.dispatchEvent(event);
});
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question