Here’s how to do it.
First make the drop-down and as the single option make a “loading” message – just to let the user know something is happening.
1 2 3
<select id="dropdown"> <option value="-">-- loading --</option> </select>
1 2 3 4 5 6 7 8 9 10 11
For convenience there’s a simple example available here. The example uses a static array as source, and in all practical uses this would probably be replaced by a database query.