EasyUI Forum
November 04, 2025, 08:05:29 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to let combobox default not to select one option  (Read 10841 times)
cdtuql
Newbie
*
Posts: 26


View Profile Email
« 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
« Last Edit: January 01, 2015, 06:45:53 AM by cdtuql » Logged
yamilbracho
Jr. Member
**
Posts: 64


View Profile Email
« Reply #1 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)
 
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!