I
I
Insom842021-04-08 00:28:29
1C-Bitrix
Insom84, 2021-04-08 00:28:29

Sending on button click to another processed file?

Hello! I don’t understand Bitrix well, but I have a question:
There is a button, its code is:

<span class="btn btn-default" data-event="jqm" data-param-id="<?=CCache::$arIBlocks[SITE_ID]['aspro_stroy_form']['aspro_stroy_question'][0]?>" data-name="question" data-autoload-NEED_PRODUCT="<?=$arResult['NAME']?>"><?=(strlen($arParams['S_ASK_QUESTION']) ? $arParams['S_ASK_QUESTION'] : GetMessage('S_ASK_QUESTION'))?></span>

It sends to the file "aspro_stroy_form"
Here is the file code:
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Заполнение формы");
?>
<style type="text/css">
section.page-top {display:none;}
.form.inline{margin-top:15px;}
.form.inline .form-header{border-top-color:transparent !important;}
</style>
<?
$id = (isset($_REQUEST["id"]) ? $_REQUEST["id"] : false);
$arFrontParametrs = CStroy::GetFrontParametrsValues(SITE_ID);
$captcha = (in_array($arFrontParametrs['USE_CAPTCHA_FORM'], array('HIDDEN', 'IMAGE', 'RECAPTCHA')) ? $arFrontParametrs['USE_CAPTCHA_FORM'] : 'NONE');
$processing = ($arFrontParametrs['DISPLAY_PROCESSING_NOTE'] === 'Y' ? 'Y' : 'N');
$isCallBack = $id == CCache::$arIBlocks[SITE_ID]["aspro_stroy_form"]["aspro_stroy_callback"][0];
$successMessage = ($isCallBack ? "<p>Наш менеджер перезвонит вам в ближайшее время.</p><p>Спасибо за ваше обращение!</p>" : "Спасибо! Ваше сообщение отправлено!");
$arDataTrigger = json_decode((isset($_REQUEST["data-trigger"]) ? $_REQUEST["data-trigger"] : '{}'), true); // allways UTF-8
?>
<?if($id):?>
  <?$APPLICATION->IncludeComponent(
    "aspro:form.stroy", "inline",
    Array(
      "IBLOCK_TYPE" => "aspro_stroy_form",
      "IBLOCK_ID" => $id,
      "USE_CAPTCHA" => $captcha,
      "DISPLAY_PROCESSING_NOTE" => $processing,
      "AJAX_MODE" => "Y",
      "AJAX_OPTION_JUMP" => "Y",
      "AJAX_OPTION_STYLE" => "Y",
      "AJAX_OPTION_HISTORY" => "N",
      "CACHE_TYPE" => "A",
      "CACHE_TIME" => "100000",
      "AJAX_OPTION_ADDITIONAL" => "",
      //"IS_PLACEHOLDER" => "Y",
      "SUCCESS_MESSAGE" => $successMessage,
      "SEND_BUTTON_NAME" => "Отправить",
      "SEND_BUTTON_CLASS" => "btn btn-default",
      "DISPLAY_CLOSE_BUTTON" => "N",
      "CLOSE_BUTTON_NAME" => "Закрыть",
      "CLOSE_BUTTON_CLASS" => "jqmClose btn btn-default bottom-close",
    )
  );?>
  <?if($arDataTrigger && strlen($name)):?>
    <script type="text/javascript">
    var name = '<?=$name?>';
    var arTriggerAttrs = <?=json_encode($arDataTrigger)?>;
    $(document).ready(function() {
      $.each(arTriggerAttrs, function(index, val){
        if( /^data\-autoload\-(.+)$/.test(index)){
          var key = index.match(/^data\-autoload\-(.+)$/)[1];
          var el = $('input[name="'+key.toUpperCase()+'"]');
          el.val(val).attr('readonly', 'readonly').attr('title', val);
        }
      });

      if(name == 'order_product'){
        if(arTriggerAttrs['data-product'].length){
          $('input[name="PRODUCT"]').val(arTriggerAttrs['data-product']).attr('readonly', 'readonly').attr('title', arTriggerAttrs['data-product']);
        }
      }
    });
    </script>
  <?endif;?>
<?else:?>
  <div class="alert alert-warning">Не указан ID формы</div>
<?endif;?>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>


I made another button, but it needs to be sent to another file, for example "aspro_stroy_form2"
I created a similar file and changed it to "aspro_stroy_form2" wherever "aspro_stroy_form" was written in it. But when clicked, the processing of the new file does not work. Somewhere it is necessary to register, something else, tell me please.
ps I do this so that the content in the popup when the button is clicked is my own, and not from that file aspro_stroy_form
I hope I explained it clearly.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question