Documentation

CForm Class

The CForm class is used to handle web forms.

Fields

Field Type Description
ID int Web form ID.
SID varchar(50) Symbol web form ID.
TIMESTAMP_X datetime Data when the web form was last modified.
NAME varchar(255) Header of the web form.
BUTTON varchar(255) Text, located on the button when filling the web form or editing of the result.
C_SORT int Sorting index.
IMAGE_ID int ID of the web form image.
DESCRIPTION varchar(2000) Description of the web form.
DESCRIPTION_TYPE varchar(4) Type of description of the web form ("text" or "html").
MAIL_EVENT_TYPE varchar(50) Mail event type ID.
FILTER_RESULT_TEMPLATE varchar(2000) Path to script that shows filter for the web form results in the administrative section of the module.
TABLE_RESULT_TEMPLATE varchar(2000) Path to script, showing the table of results web forms administrative section of the module.
STAT_EVENT1 varchar(255) EVENT1 ID of the event type for the module "Statistics".
STAT_EVENT2 varchar(255) EVENT2 ID of the event type for the module "Statistics".
STAT_EVENT3 varchar(255) Additional parameter of the event for the module "Statistics".

Methods to handle web form

Method Description Available from version
Set Adds a new web form, or updates parameters of the existing web form.
SetMailTemplate Creates the type of mail event and mail templates for the web form.
GetList Returns the list of web forms.
GetByID Returns the web form parameters by its ID.
GetBySID Returns parameters of the web form by its ID.
GetDataByID Returns arrays, describing questions and fields of the web form.
GetResultAnswerArray Returns arrays, containing description of [link=90284#question]questions[/link] and fields of the web form, as well as answers.
GetPermission Returns access permission for the web form.
Copy Copies web form.
Reset Deletes all results of the web form.
Delete Deletes a web from and all itsresults.
Check Checks all form required fields, date and time format and the file type for validity.

Methods that return HTML code for filter fields

Method Description Available from version
GetTextFilter Single line text field for filtering of text values.
GetDateFilter Two fields to enter the date range.
GetDropDownFilter Dropdown list.
GetNumberFilter Two fields to enter the number range.
GetExistFlagFilter Flag used to filter answer to question by existence.

Methods, returning HTML code for fields to input answers to questions of the web form

Method Description Available from version
GetTextField Single line text field.
GetTextAreaField Multi line text field.
GetPasswordField Single line to input password.
GetDateField Field to input the date.
GetRadioField Radio button.
GetCheckBoxField Multiple checkbox field.
GetDropDownField Single selection dropdown list.
GetMultiSelectField Multiple selection list.
GetFileField FIle input field.

Methods that get the current field value

Method Description Available from version
GetTextValue Returns current value for single line text field.
GetTextAreaValue Returns current value for multiple line text field.
GetPasswordValue Returns current value for password field.
GetDateValue Returns current value for date field.
GetRadioValue Returns current value for radio button.
GetCheckBoxValue Returns current value for multiple selection flag.
GetDropDownValue Returns current value for single selection dropdown list.
GetMultiSelectValue Returns current value for multiple selection list.

Additional methods

Method Description Available from version
IsAdmin Returns true, if the current user has admin access permissions for the Web forms module. Otherwise returns false.


© «Bitrix24», 2001-2024
Up