A
A
Alexander2021-01-09 11:33:37
1C-Bitrix
Alexander, 2021-01-09 11:33:37

How to remove “Agree to the terms” in Bitrix forms?

The first time I encountered such a problem, the regular template does not send it when filling out the form, but gives an error

Agree to the terms

Found a solution on the net that helped someone
<input type="checkbox" hidden name="licenses_subscribe" value="Y">

Pasted in different places of the template but nothing came of it.
I tried to create an agreement and insert it, but it also sucks.
Who faced?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Jupiter Max, 2021-01-09
@vardoLP

How are the forms implemented?

A
Alexander, 2021-01-09
@kikher

The problem was in AsproMax.
You need to find the /bitrix/modules/aspro.max/classes/general/CMaxEvents.php function in it
onBeforeResultAddHandler
and add the check by excluding the desired site

if((!defined('ADMIN_SECTION')) and (SITE_ID != 's2'))

finally a function
static function onBeforeResultAddHandler($WEB_FORM_ID, &$arFields, &$arrVALUES){
    if((!defined('ADMIN_SECTION')) and (SITE_ID != 's2'))
    {
      global $APPLICATION;
      $arTheme = CMax::GetFrontParametrsValues(SITE_ID);

      if($arTheme['HIDDEN_CAPTCHA'] == 'Y' && $arrVALUES['nspm'] && !isset($arrVALUES['captcha_sid']))
        	$APPLICATION->ThrowException(Loc::getMessage('ERROR_FORM_CAPTCHA'));

      	if($arTheme['SHOW_LICENCE'] == 'Y' && ((!isset($arrVALUES['licenses_popup']) || !$arrVALUES['licenses_popup']) && (!isset($arrVALUES['licenses_inline']) || !$arrVALUES['licenses_inline'])))
        	$APPLICATION->ThrowException(Loc::getMessage('ERROR_FORM_LICENSE'));
    }
  }

or add to the form
<input type="checkbox" id="licenses_popup" name="licenses_popup" checked="Y" value="Y" aria-required="true">

for help in solving thanks to PetrPo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question