There are several links with attributes. Attribute values are set via php and they are all different. Below is the form that is called when you click on any of these links. It is necessary to transfer the value of the data-model of the current link to one of the inputs of this form.
This is a template for a modal window, the parameters of the button component are passed to it in an array, including the $ arParams ['MODEL_NAME'] parameter I need.
<?$arInfo = array( "IBLOCK_ID" => $arParams['IBLOCK_ID'], "VALIDATE_EMAIL" => $arParams['VALIDATE_EMAIL'], "MODEL_NAME" => $arParams['MODEL_NAME'],);?> <form action="/.ajax.php" name="popup_form" id="popup_form_<?= $arInfo['ID_FORM'] ?>" class="popup_form" enctype="multipart/form-data" method="POST" onsubmit=""> <input type="hidden" name="iblock_id" value="<?= $arInfo['IBLOCK_ID'] ?>" /> <input type="hidden" name="validate_email" value="<?= $arInfo['VALIDATE_EMAIL'] ?>" /> <input type="hidden" name="model_name" value="<?= $arInfo['MODEL_NAME'] ?>" /> <div class="block <?= $INPUT_TYPE ?>"> <div class="input"> <input type="text" rel="<?= $arResult['PROPERTY_LIST_FULL'][$propertyID]['CODE'] ?>" id="form_text_<?= $propertyID ?>" class="input" name="PROPERTY[<?= $propertyID ?>][<?= $i ?>]" size="25" value="" /> <input type="submit" value="Отправить" /> </form> </div>
A modal window is called by an onclick, parameters are passed to show_popup from the array above, this part of the code resulted in what it looks like in generated form in html
<a href="javascript:void(0);" data-model="<?=$arParams['MODEL_NAME']?>" class="link_popup" rel="nofollow" onclick="show_popup({id: '16', model-name: 'Kia'}); $('#form_text_323').val($(this).attr('data-model')); return false;" return false;">Получить предложение</a>
The MODEL_NAME parameter is transmitted to the data-model, transmitted along with other data to show_popup, and directly in the modal emptiness itself.
show_popup
function itself implemented or not? Why the third parameter does not pass the value? - Rustam Gimranov