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 8797263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:49:07+00:00 2026-06-13T23:49:07+00:00

I am using jquery multiselct from this page http://loudev.com/ . It works well but

  • 0

I am using jquery multiselct from this page http://loudev.com/. It works well but now the system requirements need this multiselect to past the data in the order that have been selected.

No problem on the display because the data are arranged according to the selection made, but when the form is submitted, the order of the selected data is the same as the order of the selection box.

enter image description here

This is how it works base on image above:-

I have chosen Brazil, France and Australia from the drop-down box, it is arranged in the order of the choices made. After I send this form, I will receive the data should be Brazil, France and Australia as the order on the display but the data received is France, Australia and Brazil the same as the order of the selection box.

Here is the html code that plugin generated, this is for display only, when submit, it will past the original option value that have been hidden. It only set “selected” to the select in the original option if the user click on …

.

<div id="ms-public-methods" class="ms-container">
  <div class="ms-selectable">
    <ul class="ms-list">
      <li class="ms-elem-selectable ms-selected" ms-value="fr" style="display: none; ">France</li>
      <li class="ms-elem-selectable" ms-value="uk">United Kingdom</li>
      <li class="ms-elem-selectable" ms-value="us">United States</li>
      <li class="ms-elem-selectable" ms-value="ch">China</li>
      <li class="ms-elem-selectable ms-selected" ms-value="au" style="display: none; ">Australia</li>
      <li class="ms-elem-selectable" ms-value="in">India</li>
      <li class="ms-elem-selectable" ms-value="ar">Argentina</li>
      <li class="ms-elem-selectable ms-selected" ms-value="br" style="display: none; ">Brazil</li>
      <li class="ms-elem-selectable" ms-value="tb">Tibet</li>
      <li class="ms-elem-selectable" ms-value="co">Columbia</li>
      <li class="ms-elem-selectable" ms-value="cr">Croatia</li>
      <li class="ms-elem-selectable" ms-value="it">Italia</li>
      <li class="ms-elem-selectable" ms-value="es">Espana</li>
      <li class="ms-elem-selectable" ms-value="id">Indonesia</li>
      <li class="ms-elem-selectable" ms-value="du">Germany</li>
      <li class="ms-elem-selectable" ms-value="no">Norway</li>
    </ul>
  </div>
 <div class="ms-selection">
   <ul class="ms-list">
     <li class="ms-elem-selected" ms-value="br">Brazil</li>
     <li class="ms-elem-selected" ms-value="fr">France</li>
     <li class="ms-elem-selected" ms-value="au">Australia</li>
   </ul>
  </div>
</div>

Your help is very much appreciated.

  • 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-13T23:49:09+00:00Added an answer on June 13, 2026 at 11:49 pm

    Heres what I got so far. I used the callback function of the plugin and store the values into the hidden field and convert that to array. When the value is deselected itll also be removed into the hidden input field. Ive tried this and it worked!

    //sample form
    <form method="post">
        <select multiple="multiple" id="countries" name="countries[]">
          <option value="fr">France</option>
          <option value="uk">United Kingdom</option>
          <option value="us">United States</option>
          <option value="ch">China</option>
        </select>
        <input type="hidden" name="multiple_value" id="multiple_value"  />
        <input type="submit" name="submit" value="Submit" />
    </form>
    
    
    //the jquery script with callback that sets the value into the hidden field
    <script>
        $(function(){
            $('#countries').multiSelect({
              afterSelect: function(value, text){
                var get_val = $("#multiple_value").val();
                var hidden_val = (get_val != "") ? get_val+"," : get_val;
                $("#multiple_value").val(hidden_val+""+value);
              },
              afterDeselect: function(value, text){
                var get_val = $("#multiple_value").val();
                var new_val = get_val.replace(value, "");
                $("#multiple_value").val(new_val);
              }
            });
        });     
    </script>
    
     //the PHP workaround
      <?php
            if(isset($_POST['submit'])){
                $hidden = $_POST['multiple_value']; //get the values from the hidden field
                $hidden_in_array = explode(",", $hidden); //convert the values into array
                $filter_array = array_filter($hidden_in_array); //remove empty index 
                $reset_keys = array_values($filter_array); //reset the array key 
                var_dump($reset_keys); //the result
            }
      ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this plugin http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ and it works awesome!! but I'd like to make
Using jQuery Ajax to fetch data from local server: it works well with IE8
I am using a jquery multiselect plugin http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ with option. All works fine, however
Using jQuery timepickr: http://archive.plugins.jquery.com/project/jquery-timepickr Having included these files: jquery-1.7.1.min.js jquery-ui-1.8.21.custom.min.js ui.timepickr.js And getting this
Using jQuery 1.5.1 Tried this block of code in: head section as well as
Using the latest Jquery UI Multiselect it works fine in firefox, chrome but in
I'm using the jquery multiselect control from: http://abeautifulsite.net/notebook/62 I need to manually check one
Im using the JQuery UI multiselect plugin by http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ to dynamically append elements to
I implemented this solution to get a MultiSelect DropDownList Box: http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#filter However, it is
I'm using this jquery multiselect control on an asp.net webforms page. Here is the

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.