Documentation

Copy

mixed
CForm::Copy(
 int form_id,
 string check_rights = "Y"
)

The method copies web form with its questions, fields and statuses. Returns ID of the new web form on success, otherwise returns false. Non-static method.

Method parameters

Parameter Description
form_id Form ID.
check_rights Flag specifying the requirement to check current user access permissions. The following values are possible:
  • Y - check access permissions;
  • N - do not check access permissions.
To copy web form, [W] Full Access" permission for the "Web Forms module is required".
Optional parameter. Default value - "Y" (check access permissions).

See Also

Examples of use

<?
$FORM_ID = 4;
// copy the web form
if ($NEW_FORM_ID=CForm::Copy($FORM_ID))
{
    echo "Web form #4 is successfully copied into the new web form #".$NEW_FORM_ID;
}
else
{
    // print error description 
    global $strError;
    echo $strError;
}
?>


© «Bitrix24», 2001-2024
Up