<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
$this->setFrameMode(true);
CJSCore::Init([
        'masked_input'
    ]
);
?>

<div class="user_forms">

    <? if ($arResult['ERRORS']): ?>
        <div class="user_forms_error">
            <? foreach ($arResult['ERRORS'] as $error) {
                echo $error;
            }
            ?>
        </div>
    <? endif; ?>


    <form action="" method="post" class="usf" id="demo_form" enctype="multipart/form-data">
        <?= bitrix_sessid_post();
        echo '<pre>';
        print_r(bitrix_sessid_post());
        echo '</pre>';
        ?>
        <div class="user_forms_item">
            <select name="PERSONAL_CITY" id="SELECT_CITY" required>
                <option value="">
                    Выберите город
                </option>
                <? foreach ($arResult['CITIES'] as $CITY) { ?>
                    <option value="<? echo $CITY['NAME_RU'] ?>">
                        <? echo $CITY['NAME_RU'] ?>
                    </option>
                <? } ?>
            </select>
        </div>

        <div class="user_forms_item">
            <input autocomplete="off"
                   type="email"
                   name="EMAIL"
                   placeholder="Ваша электронная почта"
                   value=""
                   required>
        </div>

        <div class="user_forms_item">
            <input autocomplete="off"
                   type="text"
                   id="phone"
                   name="PERSONAL_MOBILE"
                   placeholder="Телефон"
                   value=""
                   required>
        </div>

        <div class="user_forms_item">
            <input autocomplete="off"
                   type="text" name="NAME"
                   placeholder="Имя"
                   value=""
                   required>
        </div>

        <div class="user_forms_item">
            <input autocomplete="off"
                   type="text" name="LAST_NAME"
                   placeholder="Фамилия"
                   value=""
                   required>
        </div>

        <div class="user_forms_item">
            <input autocomplete="off"
                   type="password"
                   name="PASSWORD"
                   placeholder="Придумайте пароль"
                   value=""
                   required>
        </div>



        <label class="user_forms_policy">
            <input type="checkbox">
            Нажатием кнопки <q>Зарегистрироваться</q>,
            Вы безоговорочно принимаете:
            <a href="/about/policy/">Условия политики конфиденциальности</a>, <a href="/about/rules/">Пользовательское
                соглашение</a> и
            <a href="/about/legal/">Правила использования</a>
        </label>


        <div class="user_forms_submit">
            <button class="btn btn_colored" id="confirm_submit" disabled type="submit">Зарегистрироваться</button>
        </div>


    </form>
</div>


<script>
    BX.ready(function () {
        var result = new BX.MaskedInput({
            mask: '+7 999 999 99 99', // устанавливаем маску
            input: BX('phone'),
            placeholder: '_' // символ замены +7 ___ ___ __ __
        });
        result.setValue(''); // устанавливаем значение
    });
</script>