EasyUI Forum
April 29, 2024, 12:10:35 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: Combobox onBeforeSelect  (Read 3147 times)
zombie86
Newbie
*
Posts: 24


View Profile WWW Email
« on: September 07, 2021, 06:41:28 AM »

Dears,

I need help to prevent selecting an item from combobox depending on if statement

your help is highly appreciated
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: September 07, 2021, 11:22:15 PM »

Listen to the 'onChange' event and then restore the old value if some conditions meet.
Code:
$('#cc').combobox({
onChange: function(value,oldValue) {
if (...){
$(this).combobox('setValue', oldValue)
}
}
})
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!