Documentation

GetNumberFilter

string
CForm::GetNumberFilter(
 int filter_sid,
 int size = "10",
 string add_to_text = "class=\"inputtext\""
)

The method returns HTML code for field intended either for filtering of [link= 6660053#result]results[/link] by numerical values, inputted as the answer to the web form [link= 6660053#question]question[/link], or for filtering by numerical values of the web form [link= 6660053#field]fields[/link]. Returned HTML code includes two fields, intended to enter a numerical interval. Non-static method.

Note
Names of resulting HTML fields will be generated by the following masks:
find_filter_sid_1 - first field oа numerical interval (from)
find_filter_sid_2 - second field of numerical interval (to)

Method parameters

Parameter Description Available from version
filter_sid Filter field ID. Generated by the following template:
FSID_QSID_PTYPE_integer,
где:
  • FSID - symbolic identifier of [link=90284#form]web from[/link],
  • QSID - symbolic identifier of the web from [link= 6660053#question]question[/link]/[link= 6660053#field]field[/link];
  • PTYPE - parameter type to be used for filtration. The following values are possible:
    • ANSWER_TEXT - parameter ANSWER_TEXT of the web form [link= 6660053#question]question[/link];
    • ANSWER_VALUE - parameter ANSWER_VALUE of the web form [link= 6660053#question]question[/link];
    • USER - typed values for the web form [link=90284#question]question[/link]; for the web form [link= 6660053#field]fields[/link] - this web form field value.
Examples:
  • ANKETA_AGE_USER_integer;
  • ANKETA_CAR_POWER_ANSWER_VALUE_integer.
size Width of single line text field:
<input type="text" size="size" ...>

Optional parameter. By default - "10".
add_to_text Custom HTML to be added to tags of single line text fields for input of date:
<input type="text" add_to_text ...>

Optional parameter. By default - "class=\"inputtext\"".

See Also

Examples of ue

<form name="form1" action="" method="POST">
<table>
    <tr>
        <td>Age:</td>
        <td><?
            echo CForm::GetNumberFilter(
                "ANKETA_AGE_USER_integer", 
                "10", 
                "class=\"inputtext\""
                );
            ?></td>
    </tr>
</table>
<input type="submit" value="Filter">
</form>


© «Bitrix24», 2001-2024
Up