A
A
Anto2020-10-28 10:50:22
1C-Bitrix
Anto, 2020-10-28 10:50:22

How to fill in a field in a CRM form Automatically?

Good afternoon!

Please tell me, in B24 I created a form opening with a button and posted it on the website (website on 1C-Bitrix) on the page with a list of the product catalog, this form appears when you click on the button next to the product "Order".

When you click on the Order pop up form, in this form there is a field "Product name" you need to fill it in automatically with the name of the product, in the posted script I added:

b24form({"id":"3","lang":"ru","sec":"k2eoyj","type":"button","click":"","fields": 
{values:{'LEAD_TITLE':'<?=$arItem["PROPERTIES"][$langId.'_NAME']["VALUE"];?>'}}});

The name is substituted, but in all called forms on the page of the product list, the name is displayed for the first product on the page, tell me how to substitute the name of the product on which you click?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2020-10-30
@gromdron

In order for the correct format to be displayed, it must be called from JS.
Those. you subscribe to the click event, get the name of the element and open the form in JS (execute the code), slipping the value of your product instead of php code, js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question