UJanke
October 31, 2014, 1:55pm
#1
i use serveral combos within a Form. Depending on the selections other combos will be required or not. So i try after Change:
myForm.setRequired(“myCombo”,true);
or even
myForm.setRequired(“myCombo”,false);
But that don’t will work. I know that i can use:
{type: combo, name ‘myCombo’, required:true, …}
But that don’t help since i need to set this dynamical.
Any suggestions?
(Using Prof 4.03)
With best regards,
Uwe Janke
Avalon
October 31, 2014, 2:41pm
#2
Hello,
take a look at
methods
validateItem(string name);
enableLiveValidation(boolean state);
onInputChange event
or do check onChange event for Combo, not Form.
UJanke
October 31, 2014, 3:40pm
#3
Yes of corse i can use change event, but there should also be a option to set the requierd star pn pff and also set dynamic validation on off
Avalon
November 4, 2014, 5:20pm
#4
Hello.
Can you show simple demo. In my case enableLiveValidation method works best.
Thanks.
UJanke
November 6, 2014, 11:26am
#5
Just try
var windows = new dhtmlXWindows();
var window_1 = windows.createWindow('window_1', 0, 0, 300, 400);
var str = [
{ type:"combo" , name:"form_combo_1", label:"dhxCombo1", inputWidth:120 },
{ type:"combo" , name:"form_combo_2", label:"dhxCombo2", inputWidth:120 },
{ type:"combo" , name:"form_combo_3", label:"dhxCombo3", inputWidth:120 },
{ type:"button" , name:"form_button_1", value:"Set Req" }
];
var form_1 = window_1.attachForm(str);
window_1.button('minmax').show();
window_1.button('minmax').enable();
form_1.attachEvent(‘onButtonClick’, function(name, command){
form_1.setRequired(‘form_combo_1’,true);
});
Also: jsfiddle.net/m0yr8muo/19/
it will end up in:
TypeError: this.objPull[(this.idPrefix + r)][n] is not a function
Avalon
November 6, 2014, 2:51pm
#6
Hi,
I send you private message with instruction.