Answer the question
In order to leave comments, you need to log in
How to make two forms on one page using AJAX on Bitrix?
Hello everyone - I have 2 forms on one page
<div class="reg-tab__tab js-tab-block is-active" data-tab="1" id="div_1_reg">
<?
$APPLICATION->IncludeComponent("bitrix:main.register", "temp1", Array(
"AUTH" => "N",
"REQUIRED_FIELDS" => array(
0 => "PERSONAL_PHONE",
1 => "NAME",
),
"SET_TITLE" => "Y",
"SHOW_FIELDS" => array(
0 => "NAME",
1 => "PERSONAL_PHONE",
2 => "EMAIL",
),
"SUCCESS_PAGE" => "/reg/",
"USER_PROPERTY" => "",
"USER_PROPERTY_NAME" => "",
"USE_BACKURL" => "Y",
"COMPONENT_TEMPLATE" => "temp1",
"AJAX_MODE" => "Y",
"AJAX_OPTION_STYLE" => "N",
"AJAX_OPTION_JUMP" => "N",
),
false
);?>
</div>
<div class="reg-tab__tab js-tab-block" data-tab="2" id="div_2_reg">
<?
$APPLICATION->IncludeComponent(
"bitrix:main.register",
"temp2",
array(
"AUTH" => "N",
"REQUIRED_FIELDS" => array(
0 => "PERSONAL_PHONE",
1 => "NAME",
),
"SET_TITLE" => "Y",
"SHOW_FIELDS" => array(
0 => "NAME",
1 => "EMAIL",
2 => "PERSONAL_PHONE",
3 => "WORK_COMPANY",
),
"SUCCESS_PAGE" => "/reg/",
"USER_PROPERTY" => array(
0 => "",
1 => "",
),
"USER_PROPERTY_NAME" => "",
"USE_BACKURL" => "Y",
"COMPONENT_TEMPLATE" => "temp2",
"AJAX_MODE" => "Y",
"AJAX_OPTION_STYLE" => "N",
"AJAX_OPTION_JUMP" => "N",
),
false
);?>
</div>
Answer the question
In order to leave comments, you need to log in
I can't figure out what's the problem
You don't have two forms.
You have two calls to the same component.
You need to call the component once and display as many forms as you like!
The Bitrix forum has been chewed for a long time and in several versions, take your time, register as a developer and look in the client section of the forum!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question