Hi can I add html code in "input/select". For instance text in bold ?
Regards,
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- seri_ng@seri_ng
seri_ng - 1 like
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
- C0Rrupt@thjMMvw
C0Rrupt - 0 likes
You should be able to do it with CSS alone Example: https://codepen.io/qboqx/pen/gOoJEZg /***Elgg***/ $name = 'cars'; $options = ['id'=>"carSelect_1234"]; $options_values = [["volvo"=>"Volvo"], ["saab"=>"Saab"], ["mercedes"=>"Mercedes"], ["audi"=>"Audi']]; elgg_view_field([ '#type' => 'select', 'name' => $name, 'options'=>$options, 'options_values' => $options_values, 'value' => 'can be empty or default value', ]); /***CSS***/ #carSelect_1234>option[value=saab]{font-weight:bold;} <!--HTML--> <select name="cars" id="carSelect_1234"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select>
- C0Rrupt@thjMMvw
C0Rrupt - 0 likes
$options_values = ["volvo"=>"Volvo", "saab"=>"Saab", "mercedes"=>"Mercedes", "audi"=>"Audi'];
You must log in to post replies.@Hermand Pessek. Yes you can by passing the 'style' keyword in the option of elgg_view( ) or elgg_view_field( ). See example below
elgg_view_field([
'#type' => 'select',
'name' => 'your select name',
'options_values' => 'array of options',
'value' => 'can be empty or default value',
'style' => 'font-weight:bold'
]);
Thanks. But I want only one "options_values" to be in bold.
Regards.
Correction: