Combo readonly problems


#1

Hello,

I have problem with readonly option in combo:

Required result:
I would like to get Combo only to present possible choices on the list but block choose possibility.
I want to block writing and choose from the list but I want to see list in readonly status.

My present solution (not working properly):
When I implement Combo in this way:

var form = [
{
type: “combo”,
label: “Format”,
name: “format”,
disabled: true,
options:[
{text: “AAC”, value: “AAC”},
{text: “AC3”, value: “AC3”, selected: true},
{text: “MP3”, value: “MP3”},
{text: “FLAC”, value: “FLAC”}
]},
};
newFormCombo = new dhtmlXForm(“combo_container”, form);

I can not write in combo value but I can choose it from list.

Is there any solution for that?

BR,


#2

Please, try to add the

readonly:true

to your combo initialization:

type: “combo”,
readonly:true,
//...

#3

Thank you for answer.
I tried that, unfortunately then I can not write in combo - and it is ok, but I still can select option from the list.

I want to make readonly on select from the list but open the list and still see options on the list.

BR,


#4

There is no such mode in the dhtmlxCombo.
You may try to unselect the option right after it is selected. Something like:

myCombo.attachEvent("onChange", function(value, text){
   myCombo.unSelectOption();
});