Задать вопрос
FlexStat
@FlexStat

Почему не срабатывает AJAX?

Подключаю форму для страниц каталога /catalog/index.php

В настройке указываю "AJAX_MODE" => "Y"

При попытке отправить форму , срабатывает стандартный submit, AJAX_MODE почему-то игнорируется

Код подключения формы с ajax

<?$APPLICATION->IncludeComponent(
        "demiweb:main.feedback", 
        "gal_gz", 
        array(
                "COMPONENT_TEMPLATE" => "galeon",
                "USE_CAPTCHA" => "Y",
                "AJAX_MODE" => "Y",
                "OK_TEXT" => "Спасибо, ваше сообщение принято.",
                "EMAIL_TO" => "info@dveri-galeon.com",
                "REQUIRED_FIELDS" => array(
                        0 => "NAME",
                        1 => "EMAIL",
                        2 => "MESSAGE",
                        3 => "PHONE",
                ),
                "EVENT_MESSAGE_ID" => array(
                        0 => "10",
                ),
                "PHONE" => ""
        ),
        false
);?>


При этом, подключаю тот же код на отдельной странице /site_url/index.php, в этом случае форма обрабатывается AJAX

Может кто-нибудь сталкивался с подобным поведением
  • Вопрос задан
  • 56 просмотров
Подписаться 1 Средний Комментировать
Пригласить эксперта
Ответы на вопрос 1
FlexStat
@FlexStat Автор вопроса
Полный вывод файла /catalog/index.php

<?$APPLICATION->IncludeComponent(
        "bitrix:catalog", 
        ".default", 
        array(
                "COMPONENT_TEMPLATE" => ".default",
                "IBLOCK_TYPE" => "catalog",
                "IBLOCK_ID" => "12",
                "TEMPLATE_THEME" => "green",
                "ADD_PICT_PROP" => "-",
                "LABEL_PROP" => "-",
                "MESS_BTN_BUY" => "Купить",
                "MESSAGE_404" => "",
                "MESS_BTN_ADD_TO_BASKET" => "В корзину",
                "MESS_BTN_COMPARE" => "Сравнение",
                "MESS_BTN_DETAIL" => "Подробнее",
                "MESS_NOT_AVAILABLE" => "Нет в наличии",
                "DETAIL_USE_VOTE_RATING" => "N",
                "DETAIL_USE_COMMENTS" => "N",
                "DETAIL_BRAND_USE" => "N",
                "SEF_MODE" => "Y",
                "AJAX_MODE" => "Y",
                "AJAX_OPTION_JUMP" => "N",
                "AJAX_OPTION_STYLE" => "Y",
                "AJAX_OPTION_HISTORY" => "N",
                "AJAX_OPTION_ADDITIONAL" => "",
                "CACHE_TYPE" => "N",
                "CACHE_TIME" => "36000000",
                "CACHE_FILTER" => "N",
                "CACHE_GROUPS" => "Y",
                "SET_STATUS_404" => "Y",
                "SET_TITLE" => "Y",
                "SHOW_404" => "Y",
                "ADD_SECTIONS_CHAIN" => "Y",
                "ADD_ELEMENT_CHAIN" => "N",
                "USE_ELEMENT_COUNTER" => "Y",
                "USE_FILTER" => "N",
                "FILTER_VIEW_MODE" => "VERTICAL",
                "ACTION_VARIABLE" => "action",
                "PRODUCT_ID_VARIABLE" => "id",
                "USE_COMPARE" => "N",
                "PRICE_CODE" => array(
                ),
                "USE_PRICE_COUNT" => "N",
                "SHOW_PRICE_COUNT" => "1",
                "PRICE_VAT_INCLUDE" => "Y",
                "PRICE_VAT_SHOW_VALUE" => "N",
                "BASKET_URL" => "/personal/basket.php",
                "USE_PRODUCT_QUANTITY" => "N",
                "PRODUCT_QUANTITY_VARIABLE" => "",
                "ADD_PROPERTIES_TO_BASKET" => "Y",
                "PRODUCT_PROPS_VARIABLE" => "prop",
                "PARTIAL_PRODUCT_PROPERTIES" => "N",
                "PRODUCT_PROPERTIES" => array(
                ),
                "SHOW_TOP_ELEMENTS" => "N",
                "TOP_ELEMENT_COUNT" => "9",
                "TOP_LINE_ELEMENT_COUNT" => "3",
                "TOP_ELEMENT_SORT_FIELD" => "sort",
                "TOP_ELEMENT_SORT_ORDER" => "asc",
                "TOP_ELEMENT_SORT_FIELD2" => "id",
                "TOP_ELEMENT_SORT_ORDER2" => "desc",
                "TOP_PROPERTY_CODE" => array(
                        0 => "",
                        1 => "",
                ),
                "TOP_VIEW_MODE" => "SECTION",
                "SECTION_COUNT_ELEMENTS" => "N",
                "SECTION_TOP_DEPTH" => "1",
                "SECTIONS_VIEW_MODE" => "LINE",
                "SECTIONS_SHOW_PARENT_NAME" => "N",
                "PAGE_ELEMENT_COUNT" => "28",
                "LINE_ELEMENT_COUNT" => "3",
                "ELEMENT_SORT_FIELD" => "name",
                "ELEMENT_SORT_ORDER" => "asc",
                "ELEMENT_SORT_FIELD2" => "id",
                "ELEMENT_SORT_ORDER2" => "desc",
                "LIST_PROPERTY_CODE" => array(
                        0 => "",
                        1 => "",
                ),
                "INCLUDE_SUBSECTIONS" => "N",
                "LIST_META_KEYWORDS" => "-",
                "LIST_META_DESCRIPTION" => "-",
                "LIST_BROWSER_TITLE" => "-",
                "DETAIL_PROPERTY_CODE" => array(
                        0 => "",
                        1 => "",
                ),
                "DETAIL_META_KEYWORDS" => "-",
                "DETAIL_META_DESCRIPTION" => "-",
                "DETAIL_BROWSER_TITLE" => "-",
                "DETAIL_SET_CANONICAL_URL" => "N",
                "SECTION_ID_VARIABLE" => "SECTION_ID",
                "DETAIL_CHECK_SECTION_ID_VARIABLE" => "N",
                "SHOW_DEACTIVATED" => "N",
                "DETAIL_DISPLAY_NAME" => "Y",
                "DETAIL_DETAIL_PICTURE_MODE" => "IMG",
                "DETAIL_ADD_DETAIL_TO_SLIDER" => "N",
                "DETAIL_DISPLAY_PREVIEW_TEXT_MODE" => "E",
                "LINK_IBLOCK_TYPE" => "",
                "LINK_IBLOCK_ID" => "",
                "LINK_PROPERTY_SID" => "",
                "LINK_ELEMENTS_URL" => "link.php?PARENT_ELEMENT_ID=#ELEMENT_ID#",
                "USE_STORE" => "N",
                "PAGER_TEMPLATE" => "modern",
                "DISPLAY_TOP_PAGER" => "N",
                "DISPLAY_BOTTOM_PAGER" => "Y",
                "PAGER_TITLE" => "Товары",
                "PAGER_SHOW_ALWAYS" => "N",
                "PAGER_DESC_NUMBERING" => "N",
                "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
                "PAGER_SHOW_ALL" => "N",
                "SEF_FOLDER" => "/catalog/",
                "SECTIONS_HIDE_SECTION_NAME" => "Y",
                "SEF_URL_TEMPLATES" => array(
                        "sections" => "",
                        "section" => "#SECTION_CODE_PATH#/",
                        "element" => "#SECTION_ID#/#ELEMENT_CODE#/",
                        "compare" => "compare.php?action=#ACTION_CODE#",
                ),
                "VARIABLE_ALIASES" => array(
                        "compare" => array(
                                "ACTION_CODE" => "action",
                        ),
                )
        ),
        false
);?>
<?endif;?>  

                                  <?$APPLICATION->IncludeComponent(
        "demiweb:main.feedback", 
        "galeon_spez", 
        array(
                "COMPONENT_TEMPLATE" => "galeon_spez",
                "USE_CAPTCHA" => "Y",
                "AJAX_MODE" => "Y",
                "OK_TEXT" => "Спасибо, ваше сообщение принято.",
                "EMAIL_TO" => "info@dveri-galeon.com",
                "REQUIRED_FIELDS" => array(
                        0 => "NAME",
                        1 => "EMAIL",
                        2 => "MESSAGE",
                        3 => "PHONE",
                ),
                "EVENT_MESSAGE_ID" => array(
                        0 => "10",
                ),
                "PHONE" => ""
        ),
        false
);?>
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы