Answer the question
In order to leave comments, you need to log in
How to pass a checked Checkbox when creating an infoblock element from the frontend side?
Good afternoon.
There is a form with a checkbox input, which, when submitted, creates an element in the infoblock.
Parameters are passed
$arFields = array(
"PROPERTY_VALUES" => array (
"FORM_REQUEST" => $_POST['FORM_REQUEST'] !== false ? "Y" : ""
)
);
$oElement = new CIBlockElement();
$idElement = $oElement->Add($arFields, false, false, true);
Answer the question
In order to leave comments, you need to log in
It turns out that you need to pass the value ID, like this:
"FORM_REQUEST" => isset($_POST['FORM_REQUEST']) ? array(4) : ''
3Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question