Answer the question
In order to leave comments, you need to log in
How to pass the product name in Bitrix to the form result?
How to pass the name of the product on the page of which it is located to the form result? I am using the web form component.
Answer the question
In order to leave comments, you need to log in
1. In the admin panel Settings-->Modules settings-->Web forms, uncheck "Use simplified form editing mode" so that the fields can be assigned a symbolic code.
2. In the settings of your web form, you create a "question", for example, "Product name", with the symbolic code ELEMENT_NAME, add an "answer" field type hidden
3. Add a parameter to the call of the web form component, for example like this
"ELEMENT_NAME" => array(
"VALUE" => $arResult["NAME"],
"AUTOCOMPLETE" => "Y"
)
foreach ($arResult["QUESTIONS"] as $FIELD_SID => $arQuestion)
{
if(isset($arParams[$FIELD_SID]) && $arParams[$FIELD_SID]['VALUE'] && $arParams[$FIELD_SID]['AUTOCOMPLETE'] == 'Y') {
$arQuestion['HTML_CODE'] = str_replace('name=', 'value="'.$arParams[$FIELD_SID]['VALUE'].'" name=', $arQuestion['HTML_CODE']);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question