EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: cdtuql on January 01, 2015, 05:18:46 AM



Title: how to let combobox default not to select one option
Post by: cdtuql on January 01, 2015, 05:18:46 AM
how to let combobox default not to select one option?
the standard <select> elemet ,default not select one option ,but i want to use this state;
can the combobox action like the sdandard <element> ,how can i do?thanks


Title: Re: how to let combobox default not to select one option
Post by: yamilbracho on January 02, 2015, 08:44:30 AM
You can add a "placeholder" and not selectable option like this

<option selected disabled hidden value=''>Please, select one option</option>
or
<option value="" style="display:none;"></option>

another way is

$('#cc').combobox().prop('selectedIndex', -1)
or
$('#cc').combobox()..attr("selectedIndex", -1)