Documentation

GetTextFilter

string
CForm::GetTextFilter(
 int filter_sid,
 int size = 45,
 string add_to_text = "class=\"inputtext\"",
 string add_to_checkbox = "class=\"inputcheckbox\""
)

The method returns HTML code for the filter field, intended to filter the [link=90284#result]results[/link] by text values of [link=90284#answer]answers[/link] to the [link=90284#question]web form questions[/link] or text values of the web form [link=90284#field]fields[/link]. The returned HTML code includes a single line text field and the flag to specify the filtration details. Non-static method.

Note
Names of resulting HTML fields will be generated by the the following masks:
find_filter_sid - single line text field
find_filter_sid_exact_match - flag to specify filtration details

Method parameters

Parameter Description Available from version
filter_sid ID of filter field. Generated based on the following template:
FSID_QSID_PTYPE_text,
где:
  • FSID - symbolic ID of the [link=90284#form]web form[/link];
  • QSID - symbolic ID of the [link=90284#question]question[/link]/[link=90284#field]field[/link] of the web form;
  • PTYPE - parameter type used to define filtration. The following values are possible:
    • ANSWER_TEXT - ANSWER_TEXT parameter of the web form [link=90284#question]question[/link];
    • ANSWER_VALUE - ANSWER_VALUE parameter of the web form [link=90284#question]question[/link];
    • USER - for web from [link=90284#question]question[/link] - typed value, for the web form [link=90284#field]fields[/link] - web form field value.
Examples:
  • ANKETA_USER_NAME_USER_text;
  • ANKETA_TEST_FIELD_USER_text.
size Width of the single line text field:
<input type="text" size="size" ...>

Optional parameter. Default value: "45".
add_to_text Custom HTML, added to the tag of single line field:
<input type="text" add_to_text ...>

Optional parameter. Default value: "class='typeinput'". From version 4.0.4 - "class=\"inputtext\""
3.2.5
add_to_checkbox Custom HTML, added to the tag of the flag, defining filtration details:
<input type="checkbox" add_to_checkbox ...>

Optional parameter. Default value: "class=\"inputcheckbox\"".
3.3.10

See Also

  • [link=90296]CForm::GetDateFilter[/link]
  • [link=90299]CForm::GetDropDownFilter[/link]
  • [link=90306]CForm::GetNumberFilter[/link]
  • [link=90301]CForm::GetExistFlagFilter[/link]

Examples of use

<form action="" method="POST">
<table>
    <tr>
        <td>Last name:</td>
        <td><?
            echo CForm::GetTextFilter(
                "ANKETA_USER_NAME_USER_text", 
                45, 
                "class=\"inputtext\"", 
                "class=\"inputcheckbox\""
                );
            ?></td>
    </tr>
</table>
<input type="submit" value="Фильтр">
</form>


© «Bitrix24», 2001-2024
Up