Home:ALL Converter>Populate dropdown list dynamically using jquery

Populate dropdown list dynamically using jquery

Ask Time:2015-02-25T05:40:44         Author:Alla

Json Formatter

I'm using SharePoint 2010, jquery-1.9.0.min.js and need to populate asp dropdown list based on users' AD groups. I already have the code getting AD groups and getting the values that need to go into dropdown list. The dropdown list would have any combination of 2 to 4 items (text and values), then selected item should flow into the web parts on the same web page. I'm new to SharePoint/jquery and not sure how setup the dropdown list options dynamically. I had setup dropdown list with bogus texts and values and need to replace it with valid values for each user. I'd like to use jquery if possible. If there is another simpler way - please let me know. I'd need to know how to add 1 or 2 additional options if needed.

<asp:DropDownList runat="server" id="DropDownList1" AutoPostBack="True">
                            <asp:ListItem value="06">Fac1</asp:ListItem>
                            <asp:ListItem value ="07">Fac2</asp:ListItem>
                        </asp:DropDownList>

Author:Alla,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/28706872/populate-dropdown-list-dynamically-using-jquery
yy