onChange checkbox trouble

Code:

this.SearchForm.loadStruct("search.xml", function(){ this.attachEvent("onChange", function (id, value){ return FormSearchEx(id,value,this.MyFinestra); }); });

search.xml

<items> <item type="hidden" name="id" value="" label="id" /> <item type="input" name="codice" value="" label="Codice" /> <item type="input" name="descrizione" value="" label="Descrizione" /> <item type="checkbox" name="assegnato" value="" label="Assegnato" /> <item type="button" value="Cerca"/> </items>

Why, when the checkbox was checked the onChange don’t return value?

In case of checkbox you should use 3rd parameter of “onChange” event handler:

myForm.attachEvent("onChange",function(id,value,state){ //state - checked state (for checkboxes and radios only ) });

docs.dhtmlx.com/doku.php?id=dhtm … t_onchange

Thank you… but where is written this info?
Not here (docs.dhtmlx.com/doku.php?id=dhtm … t_onchange) for sure! :slight_smile:

There is in some place a more updated documentation?

Not here
Parameters for inputs:
an item id
an item value
a checked state (for checkboxes and radios only )

Add this code to be more clear:

myform.attachEvent(“onChange”, function (id, value,state){
//any custom logic here
});

Thanks, documentation fixed