I am working on creating a webpage using the Semantic UI Framework. I am new to UI and jquery interfaces. I use the multi-page Dropdown component to select roles for the user. I can implement a drop down list and select values.
But can anyone help me set the default value (preselected) in the drop down list? I tried the behavior indicated here , but for some reason cannot make it work. Is something missing here?
Here is the fiddle and code.
My HTML :
<div class="twelve wide field"> <label style="width: 250px">Add roles to user</label> <select name="skills" multiple="" class="ui fluid dropdown"> <option value="">Roles</option> <option value="Role1">Role 1</option> <option value="Role2">Role 2</option> <option value="Role3">Role 3</option> </select> </div>
My JavaScript :
$(".ui.fluid.dropdown").dropdown({ allowLabels:true}) $('.ui.fluid.dropdown').dropdown({'set selected': 'Role1,Role2'});
Also, can I get help in retrieving variable values ββin javascript?
jquery css multi-select semantic-ui
Phanikanth
source share