A
A
Andy Oker2021-02-15 21:12:46
1C-Bitrix
Andy Oker, 2021-02-15 21:12:46

How to add a field with a phone number in the standard feedback component?

I have a standard feedback component code.
I also want to add a field with a phone number to the form, how can I customize this code so that it works?

<?
if(!defined("B_PROLOG_INCLUDED")||B_PROLOG_INCLUDED!==true)die();
/**
 * Bitrix vars
 *
 * @var array $arParams
 * @var array $arResult
 * @var CBitrixComponentTemplate $this
 * @global CMain $APPLICATION
 * @global CUser $USER
 */
?>
<div class="mfeedback">
<?if(!empty($arResult["ERROR_MESSAGE"]))
{
  foreach($arResult["ERROR_MESSAGE"] as $v)
    ShowError($v);
}
if($arResult["OK_MESSAGE"] <> '')
{
  ?><div class="mf-ok-text"><?=$arResult["OK_MESSAGE"]?></div><?
}
?>

<form action="<?=POST_FORM_ACTION_URI?>" method="POST">
<?=bitrix_sessid_post()?>
  <div class="mf-name">
    <div class="mf-text">
      <?=GetMessage("MFT_NAME")?><?if(empty($arParams["REQUIRED_FIELDS"]) || in_array("NAME", $arParams["REQUIRED_FIELDS"])):?><span class="mf-req">*</span><?endif?>
    </div>
    <input type="text" name="user_name" value="<?=$arResult["AUTHOR_NAME"]?>">
  </div>
  <div class="mf-email">
    <div class="mf-text">
      <?=GetMessage("MFT_EMAIL")?><?if(empty($arParams["REQUIRED_FIELDS"]) || in_array("EMAIL", $arParams["REQUIRED_FIELDS"])):?><span class="mf-req">*</span><?endif?>
    </div>
    <input type="text" name="user_email" value="<?=$arResult["AUTHOR_EMAIL"]?>">
  </div>

  <div class="mf-message">
    <div class="mf-text">
      <?=GetMessage("MFT_MESSAGE")?><?if(empty($arParams["REQUIRED_FIELDS"]) || in_array("MESSAGE", $arParams["REQUIRED_FIELDS"])):?><span class="mf-req">*</span><?endif?>
    </div>
    <textarea name="MESSAGE" rows="5" cols="40"><?=$arResult["MESSAGE"]?></textarea>
  </div>

  <?if($arParams["USE_CAPTCHA"] == "Y"):?>
  <div class="mf-captcha">
    <div class="mf-text"><?=GetMessage("MFT_CAPTCHA")?></div>
    <input type="hidden" name="captcha_sid" value="<?=$arResult["capCode"]?>">
    <img src="/bitrix/tools/captcha.php?captcha_sid=<?=$arResult["capCode"]?>" width="180" height="40" alt="CAPTCHA">
    <div class="mf-text"><?=GetMessage("MFT_CAPTCHA_CODE")?><span class="mf-req">*</span></div>
    <input type="text" name="captcha_word" size="30" maxlength="50" value="">
  </div>
  <?endif;?>
  <input type="hidden" name="PARAMS_HASH" value="<?=$arResult["PARAMS_HASH"]?>">
  <input type="submit" name="submit" value="<?=GetMessage("MFT_SUBMIT")?>">
</form>
</div>

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