Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:07:43+00:00 2026-06-11T16:07:43+00:00

I am using a jQuery multiselect dropdown in ASP.NET I need to get all

  • 0

I am using a jQuery multiselect dropdown in ASP.NET I need to get all the selected values, but I am getting only the last selected value from the dropdownlist on the server side after postback.

Script:

<script type="text/javascript">
    $(document).ready(function () {
        $('.department).multiselect({
            show: ["bounce", 5], hide: ["blind", 1],
            close: function () {
                debugger;
                var values = new Array();
                $(this).multiselect("getChecked").each(function (index, item) {
                     values.push($(item).val());
                });
                $("input[id*=selectedValues]").val(values.join(","));
                document.getElementById("<%=hdnDepartment.ClientID %>").value = values;
           }
       })
      .multiselectfilter();
    });
</script>
<asp:HiddenField ID="hdnDepartment" runat="server"></asp:HiddenField>
<asp:HiddenField ID="hdnEmployee" runat="server" />
<asp:DropDownList ID="ddlDepartment" runat="server" Width="150px" CssClass="department" onselectedindexchanged="ddlDepartment_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:07:45+00:00Added an answer on June 11, 2026 at 4:07 pm

    Try joining the values and then writing it to a hidden field..

    $('[id*=hdnDepartment]").val(values.join()) ;
    
            //OR 
    document.getElementById("<%=hdnDepartment.ClientID %>").value = values.join();
    

    Also looks like you are losing the vent once the postback occurs. So you need to reattach it once the postback is done .. Try this.

    <script type="text/javascript">
        $(document).ready(function () {
            PostBack();
    
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(PostBack);
        });
    
        function PostBack(){
            $('.department).multiselect({
                show: ["bounce", 5], hide: ["blind", 1],
                close: function () {
                    debugger;
                    var values = new Array();
                    $(this).multiselect("getChecked").each(function (index, item) {
                         values.push($(item).val());
                    });
                    $("input[id*=selectedValues]").val(values.join(","));
                    document.getElementById("<%=hdnDepartment.ClientID %>").value = values;
               }
           })
          .multiselectfilter();
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the jquery multiselect control from: http://abeautifulsite.net/notebook/62 I need to manually check one
I'm using this jquery multiselect control on an asp.net webforms page. Here is the
Using jQuery, how can I get the selected item's value in a select when
Using JQuery I am trying to perform validation and also get the values of
I am using jquery multiselect widget. I would like to uncheck all if all
I'm using the following jquery multiselect plugin ... How can I grab the selected
I am using jquery multiselect plugin, If an option has been selected i would
I am using a jquery multiselect plugin http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ with option. All works fine, however
Using jQuery Multiselect plugin and need to check if any selections have been made
I'm using the Jquery multiselect checkbox plugin and am getting an error when converting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.