A
A
adam_carraway2019-05-18 18:11:43
1C-Bitrix
adam_carraway, 2019-05-18 18:11:43

Where to look for form handlers on the bitrix website?

Good afternoon, the site has several forms, the site is on 1c-bitrix. I need that after sending these forms to the server, this data is also sent to another site. A question in that where to search for handlers of these forms?
One form is in a footer, where can I find that footer ?
Here is an example of calling a form

<div class="contacts__feedback">
     <?$APPLICATION->IncludeComponent(
  "citfact:form",
  "feedback",
  Array(
    "AJAX" => "Y",
    "ALIAS_FIELDS" => array("NAME"=>"Как к Вам обращаться*","EMAIL"=>"Ваша электронная почта*","PHONE"=>"Ваш номер телефона*","MESSAGE"=>"Ваше обращение*",),
    "ATTACH_FIELDS" => array(),
    "BUILDER" => "",
    "CACHE_GROUPS" => "Y",
    "CACHE_TIME" => "36000000",
    "CACHE_TYPE" => "A",
    "COMPONENT_TEMPLATE" => "feedback",
    "DISPLAY_FIELDS" => array(0=>"NAME",1=>"EMAIL",2=>"PHONE",3=>"MESSAGE",4=>"",),
    "EVENT_NAME" => "FEEDBACK_FORM",
    "EVENT_TEMPLATE" => "",
    "EVENT_TYPE" => "",
    "ID" => "21",
    "REDIRECT_PATH" => "",
    "STORAGE" => "",
    "TYPE" => "IBLOCK",
    "USE_CAPTCHA" => "N",
    "USE_CSRF" => "Y",
    "VALIDATOR" => ""
  )
);?>
  </div>

UPD where to look for the component
<?$APPLICATION->IncludeComponent(
  "citfact:form",
  "feedback",

?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Gritsuk, 2019-05-19
@adam_carraway

citfact:form is most likely a customized bitrix:feedback
component , since this component is not standard, it can be safely added to suit your needs. The component code will be here:
./bitrix/components/citfact/form/
or
./local/components/citfact/form/
If for some reason you do not want to change the component code, you can write your code in the OnBeforeEventAdd event handler . The link has an example of how to connect your handler. The bottom line is that the citrus.form component, judging by the parameters, sends a letter to the mail.
The EVENT_NAME parameter specifies the FEEDBACK_FORM mail event. Catch this mail event in the OnBeforeEventAdd event handler and execute your code.

A
Adamos, 2019-05-18
@Adamos

It is useless to look for forms, the traces will lead deep into the components, where the Bitrix TP does not advise to meddle, because when updating, all your edits will go to the forest.
There is a True Peranal Path of Bitrix - add a handler to /bitrix/php_interface/init.php:

function yourHandler($WEB_FORM_ID, $RESULT_ID)
{
  if ($WEB_FORM_ID == YOUR_NUMBER) // номер той формы, которую вы хотите поймать
  {
    $fields = array();
    $arAnswers = CFormResult::GetDataByID($RESULT_ID, $fields); 
          // отправленные в форме данные в $arAnswers, можно что-то с ними сделать
  }
}
AddEventHandler('form', 'onAfterResultAdd', 'yourHandler');
AddEventHandler('form', 'onAfterResultUpdate', 'yourHandler');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question