Combo and Required flag Dynamical

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

Hello,

take a look at

methods validateItem(string name); enableLiveValidation(boolean state);

onInputChange event

or do check onChange event for Combo, not Form.

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

Hello.
Can you show simple demo. In my case enableLiveValidation method works best.

Thanks.

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

Hi,

I send you private message with instruction.