For some reason I only get to the first option when I alert out below and then it exists my entire function. It never iterates through each option:
function SelectAlbumOption(iAlbumID, iAlbumDropdownID)
{
var dropdownID = '#' + iAlbumDropdownID;
$(dropdownID).each(function(index, currentOption)
{
alert("(currentOption).attr('value'): " + $(currentOption).attr("value"));
if($(currentOption).attr("value") == iAlbumID)
{
alert("matched option");
$(currentOption).attr("selected", "yes");
return false;
}
});
}
right before this function above is called, I add options to that select, so they do exist before this function is called.