EasyUI Forum
September 13, 2025, 02:20:34 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: Form + combotree  (Read 9509 times)
rezzonico
Full Member
***
Posts: 186


View Profile
« on: July 21, 2015, 03:58:21 AM »

Hi all,

I have the following form:
http://195.144.40.170/AAA/index.html

When I hit "Submit" the message "This field is required" appears near the first field.
Now write a text in the first field and hit "Submit" again.
Near the second field doesn't appear the text "This field is required".
Why ?
The only difference is that the first field is a textbox and the second field is a combotree.

Any help is appreciated.
Regards.
Miche
« Last Edit: July 21, 2015, 03:59:52 AM by rezzonico » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 21, 2015, 06:52:04 PM »

Please try to set the 'editable' property to true for your combo tree component.
Logged
rezzonico
Full Member
***
Posts: 186


View Profile
« Reply #2 on: July 22, 2015, 07:28:56 AM »

Hi Stworthy,

I have modified the code as suggested and it works.
Unfortunately now I have another problem ...
Now the user can edit the field and I want to avoid this ...

In other words the user must only be able to select the value from the combotree.

Regards
Miche
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: July 22, 2015, 08:23:46 AM »

A readonly validatebox can not auto display the tip message when validating. If you really want to let it display the tip message, please try to override the $.fn.combotree.defaults.events.focus function.
Code:
$.fn.combotree.defaults.events.focus = function(e){
var target = e.data.target;
var state = $.data(target, 'validatebox');
var box = $(target);
// if ($(target).attr('readonly')){return;}
state.validating = true;
state.value = undefined;
(function(){
if (state.validating){
if (state.value != box.val()){ // when box value changed, validate it
state.value = box.val();
if (state.timer){
clearTimeout(state.timer);
}
state.timer = setTimeout(function(){
$(target).validatebox('validate');
}, state.options.delay);
} else {
if (state && state.tip){
$(target).tooltip('reposition');
}
}
setTimeout(arguments.callee, 200);
}
})();
}
Logged
rezzonico
Full Member
***
Posts: 186


View Profile
« Reply #4 on: July 23, 2015, 04:09:07 AM »

Hi Stworthy,

thanks a lot for your help !

Regards.
Miche
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!