Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Barbara on Nov 30, 2007 07:34
open dhtmlx forum
dhtmlxCombo option selected='true' and onchange event

Hi all,

I've a dhtmlxCombo with:

var z=new dhtmlXCombo("combo_zone","UtResidenteIn",350);
z.enableFilteringMode(true,"loadComuniCap.php?UtResidenteIn=<?php echo $UtResidenteIn ?>",true,true);

and in loadComuniCap.php I make a query to get UtResidenteIn that is the default value for the combo.

I've put <option selected='true' for the result query's value, but it's is not shown in the first option.
I see that there is because if I type another first char I see it first in the list of options, but I would like it's visible
without typing.

Another question is the same all make to you: the onchange event.
I've red all answers but I can't understand how the

combo.attachEvent("onChange",function(event){
//code here
})

is associated with the name of the combo? I can't understand where to put that code...
I've more than one combo. I'm new in javascript and ajax... :-(

Thanks in advance
Barbara
Answer posted by Support on Nov 30, 2007 10:59
>>combo.attachEvent("onChange",function(event){

In all events you can use "this" as pointer to object where event occured

combo.attachEvent("onChange",function(event){
    this.setComboValue(new_one);
})