Answer the question
In order to leave comments, you need to log in
Where are the forms in Bitrix?
Hello. I want to set a goal from Yandex.Metrica to a modal window button in Bitrix. I can't find them in the template.
The bottom line: the site has a button number 1, you press on it ---> a modal window appears with 2-3 fields and a button number 2 "Submit".
Objective: Target button #2.
How did you search? In Total Commander - search in the text by id - this button. Finds nothing. Where do such things lie in Bitrix? Where to look for?
Answer the question
In order to leave comments, you need to log in
With forms (if we mean web forms), confusion is possible, since not a component template can be connected, but a web form template redefined in its settings.
I would not intermeddle there, but at first I just tried to hang a click on the button.
For example, our form has name=" SIMPLE_FORM_3 "
That is, we
write a function and call it when the page loads:<form ... name= "SIMPLE_FORM_3" ... >
function form_mark() {
//Получаем кнопку в форме
let form_submit= document.querySelector( 'form[name="SIMPLE_FORM_3"] input[type="submit"]' );
if ( !form_submit ) {
return;
}
//Вешаем дополнительное событие на кнопку на клик
form.submit.addEventListener( 'click', function() { ... } );
}
//Вешаем дополнительное событие на windows на загрузку
window.addEventListener( 'load', form_mark );
There are several options:
1) Modal window "normal popup" pure html. The content of the module window is usually hidden (at the end of the html form site template). Search for and hang up the goal on the button
2) The modal window "on Ajax" is pure html. The content of the module window is usually located in an ajax-rendered file in the include folder or in the template, and sometimes directly in the root directory. Look at the link and look for the file, and hang the target on the button
3) Modal window "on Ajax" on the component. Look for a file, see which component template is used, edit the template and put a target on the button
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question