I integrate the zip code anywhere with my web project. I am using drop drop for the county / state field. A zip code anywhere returns the name of the county. Can I change the selected index when I only have a name? (I use a number for the value field related to the database field).
I tried the following:
var f = document.getElementById("state_dropdown");
f.options.[f.selectedIndex].text = response[0].County;
I tried to include the html dropdown code here, but for some reason I can't get it to work fine.
But of course, this just changes the text box for the item in the drop-down list that is already selected.
I can query the database and find out which identifier I assigned to the county, but I would prefer if there is another way.
source
share