A
A
Askfortrue2019-12-09 18:22:19
1C-Bitrix
Askfortrue, 2019-12-09 18:22:19

How to pass a pre-selected value (its ID) of a pre-selected property to the form for adding / editing iblock.element.add.form elements?

How to pass a pre-selected value of a pre-selected infoblock property to the iblock.element.add.form add/edit form?
That is, we have a property in the infoblock, we have a number of values, the IDs of these values ​​and the ID of this property are known.
Here, in the form, indicate the presence of this property and designate the ID of one of its values, without actually selecting anything in the form, the value ID already exists, you can generally not display this property for editing.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2019-12-09
@anton99zel

<?
//в компоненте
$APPLICATION->IncludeComponent(
  "bitrix:iblock.element.add.form",
///////..........
    "PROPERTY_CODES" => array("PROPERTY_СИМВОЛЬНЫЙКОДСВОЙСТВА"),
//////..........
);?>

In template, example:
css
html
<select id="town">
  <option value="Moscow">Москва</option>
  <option value="St. Petersburg">Санкт-Петербург</option>
  <option value="Sochi">Сочи</option>
  <option value="Novosibirsk" selected>Новосибирск</option>
  <option value="Kazan">Казань</option>
</select>

jQuery
Or just add selected="selected" to option
Or become advanced
https://dev.1c-bitrix.ru/api_help/iblock/classes/c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question