EasyUI Forum
May 03, 2024, 12:28:20 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 setValue for non-existent value  (Read 22829 times)
2plus2
Jr. Member
**
Posts: 75


View Profile
« on: June 13, 2013, 04:58:05 PM »

When you do a load form, with a combobox, if you have a value to "set" in the combo box and the value doesn't exist, the load method puts the unmatched value in the textbox. e.g. I'm trying to set the combobox value to "5", and since 5 doesn't exist in the drop down, "5" is put in the textbox instead.

It should just not load the value at all. (Same with form submission, if the data in the text box doesn't match an option in the drop down, it shouldn't submit that unmatch value/text with the form submission.)

Anyway, is there an event I can utilize to detect this "failed" setValue? Or do I have to manually check it with the validate / isValid method immediately after setting it?

UPDATE: Here is a Fiddle I setup to show the action described above:

http://jsfiddle.net/FrEHv/

I also added the validate / isValid check - and it always returns true. How can I verify the data entered if it's always validates true? Or am I using this method incorrectly?
« Last Edit: June 13, 2013, 06:18:24 PM by 2plus2 » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 13, 2013, 06:50:14 PM »

Here is the updated example that extends the 'exists' validating type.
http://jsfiddle.net/FrEHv/1/
Logged
2plus2
Jr. Member
**
Posts: 75


View Profile
« Reply #2 on: June 14, 2013, 10:18:22 AM »

Thanks - much appreciated.
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!