SelectBox
string CCurrency::SelectBox( string sFieldName, string sValue, string sDefaultValue = "", bool bFullName = True, string JavaFunc = "", string sAdditionalParams = "" );
The SelectBox method is intended for building the ready-to-use HTML code of the drop-down list of currencies (<SELECT>
).
The built list of currencies is stored in the cache. Therefore, displaying the same drop-down lists within the same page does not incur extra queries to the database. Non-static method.
Method parameters
Parameter | Description |
---|---|
sFieldName | Name of the drop-down list. |
sValue | Currency ID code, which is to be selected in the list. |
sDefaultValue | In the list, a special value which corresponds to none of existing currencies. For example, the value All or Not specified. In this case, the currency ID will be empty in the list. If the parameter is empty, no special value is included in the list. |
bFullName | Specifies to show the full currency name. If the parameter is false, the list contains three character currency codes only. Optional parameter. |
JavaFunc | Name of the JavaScript method which is called when the OnChange event of the list fires. If the value is empty, the method is not called. Optional parameter. |
sAdditionalParams | String containing additional arbitrary parameters to include in the <select> tag. Optional parameter. |
Returned values
String containing a code for building the drop-down list of currencies.
examples of use
<? // Display the drop-down list of currencies // named CURRENCY_DEFAULT, with the currency USD // which has been selected by default, without a special value. echo CCurrency::SelectBox("CURRENCY_DEFAULT", "RUR", "", True, "", "class='typeselect'"); ?>
© «Bitrix24», 2001-2024