Copy
mixed CFormField::Copy( int field_id, string check_rights = "Y", mixed form_id = false )
The method Copy copies a question or a field of a web form. Returns the ID the new question or field on success, or false otherwise.
Parameters
Parameter | Description |
---|---|
field_id | The ID of the question or the field which is to be copied. |
check_rights | Flag specifying the current user permissions
should be checked. One of the following values is possible:
|
form_id | The ID of the destination web form to which a question
or a field should be copied. Optional. False by default which means that the current web form is used. |
Example
<? $FIELD_ID = 140; // The question ID // copy the question if ($NEW_FIELD_ID=CFormField::Copy($FIELD_ID)) { echo "The question #140 has been successfully copied to the new question #".$NEW_FIELD_ID; } else { // display the error description global $strError; echo $strError; } ?>
© «Bitrix24», 2001-2024