This is not exactly "combo box"; this is HTML
select
element. By "display", you may mean selecting the item (
option
element) depending on some value you
Of course, you cannot use jQuery
.load
here. Please see what it does:
https://api.jquery.com/load[
^].
It places some HTML in the element. This is not what you want. You want to remove
selected
attribute from one
option
element and either add this attribute to some other (or maybe the same) element, or none of them, in case there is no match.
The implementations of these operations are explained here; please see top answer to the question:
http://stackoverflow.com/questions/314636/how-do-you-select-a-particular-option-in-a-select-element-in-jquery[
^].
Instead of
.load
, you need to just extract the value from service. Use general-purpose jQuery Ajax:
http://api.jquery.com/jquery.ajax[
^].
That's all. As you can see, this is considerably more tricky than
.load
, but nothing too hard.
—SA