Answer the question
In order to leave comments, you need to log in
How to make two identical forms work on one page in Bitrix?
Hi all. Guys, help me out. I must say right away that I am new to Bitrix, and therefore I need your help.
A problem has appeared. I am making an information page that has two identical forms that add information to one information block. Basically, the form consists of an email field and a submit button.
What I've done?!
1. Created an information block
2. Made a template (bitrix:iblock.element.add.form) with the following code:
<form id="forma_econ" name="iblock_add" action="<?=POST_FORM_ACTION_URI?>" method="post" enctype="multipart/form-data">
<?=bitrix_sessid_post()?>
<div class="forma_econ">
<div class="forma_econ_mail"><input autocomplete="off" placeholder="<?=GetMessage("EMAIL_TEXT_PL")?>" name="PROPERTY[NAME][0]" type="text" value=""></div>
<div class="forma_econ_submit"><input type="submit" name="iblock_submit" value="<?=GetMessage("IBLOCK_FORM_SUBMIT")?>" /></div>
</div>
<input type="hidden" name="FORM_ID" value="<?=$arParams["FORM_ID"]?>">
</form>
Answer the question
In order to leave comments, you need to log in
There are three options:
1. Buffer restart.
Copy the template for the second component. Put the following code before the form:
<? if (count($arResult["ERRORS"]) > 0 || !empty($arResult["MESSAGE"])) {
$APPLICATION->RestartBuffer();
// здесь обработка MESSAGE или ERRORS
die();
}
?>
id="forma_econ"
id="forma_econ<?=$arParams["FORM_ID"]?>"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question