merging with javascript

Hi there,

I really like the (show)image option of the combobox, but I can’t make it work with my search engine:

[code]




Google.com Yahoo.com Bing.com [/code]

When I press enter or hit the search button it gives me a new tab/window ‘‘about:blank’’ instead off the expected search results. I have tried every possible combination but I can’t seem to merge the image option. Please help me with this becouse I really want to integrate this option.

Hi,

to select combo option you should use combo API:

selectOption method:

combo.selectOption(optionIndex);

Method getActualValue returns the selected value.

Hi Alexandra,

Thank’s for your response.

I have read combo API but it doesn’t explain a search query. I have also tried:

And also:

Both suggestions don’t seem to work. Maybe I misunderstood, in that case; can you please be more specific ? If not, is there some other way of making this work ?

Hi,

probably the combo shouldn’t be empty. Therefore you need to load some data to the combo:

var combo = new dhtmlXCombo(“combo_zone”,“whichEngine”,200,“image”);
combo.loadXML(url);

The selectOption method can be called when the options are loaded. If you want to select the option rigth after xml loading, you may use the 2nd parameter of the load XML method:

combo.loadXML(url,function(){
combo.selectOption(getActualValue);
});

Hi Alexandra,

This is what I have so far:

[code]

search-engines
[/code]

It’s not working…I don’t get it. Am I using the wrong doctype ? Am I missing a (js)file ?

Hi,

selectOption method selects the option by its index:

combo.selectOption(0); => the first option will be selected

To select option by its value (option key) you may use the setComboValue(value) method:

combo.setComboValue(value);

Check the list of combo methods:

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