V
V
Vitaly2018-09-03 10:00:38
1C-Bitrix
Vitaly, 2018-09-03 10:00:38

Bitrix: AJAX feedback form, why is it not sent to fancybox3?

Fancybox3 is connected.
Calling a modal window with content loading:

<a data-fancybox data-type="ajax" data-src="<?=SITE_DIR?>ajax/modal/appointmentModal.php" href="javascript:;" class="btnMain fill">форма обратной связи</a>

appointmentModal.php file:
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); 
$APPLICATION->IncludeComponent(
  "bitrix:main.feedback", 
  "appointment",  
  array(
    "COMPONENT_TEMPLATE" => "feedback",
    "USE_CAPTCHA" => "N",
    "OK_TEXT" => "Спасибо, ваше сообщение принято.",
    "EMAIL_TO" => "[email protected]",
    "REQUIRED_FIELDS" => array(
      0 => "TELL",
      1 => "ASSENT",
    ),
    "EVENT_MESSAGE_ID" => array(
    ),
    "AJAX_MODE" => "Y",
    "AJAX_OPTION_SHADOW" => "N",
    "AJAX_OPTION_JUMP" => "N",
    "AJAX_OPTION_STYLE" => "Y",
    "AJAX_OPTION_HISTORY" => "N"
  ),
  false
);
  require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php");

Everything loads correctly, the problem is when submitting the form. The form is not sent, but there is a transition to the appointmentModal.php file. Error in console
Uncaught TypeError: Cannot read property 'ajax' of undefined
    at appointmentModal.php?fancybox=true:3

In fancybox2, this form is submitted. Can't figure out how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2018-09-03
@babarun

Try replacing with data-type="iframe"and"AJAX_MODE" => "N"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question