logo
down
shadow

How to reset the select box values in Jquery sumoselect Multi select plugin


How to reset the select box values in Jquery sumoselect Multi select plugin

By : user2957661
Date : November 24 2020, 01:01 AM
it should still fix some issue You can use the sumo.unSelectItem();. Source here
code :
$(document).ready(function () {
   $('.SlectBox').SumoSelect({  okCancelInMulti: true });

   $('button').on('click', function(){
     var num = $('option').length;
     for(var i=0; i<num; i++){
       $('.SlectBox')[0].sumo.unSelectItem(i);
     }
   });

});
$('button').on('click', function () {
    var obj = [];
    $('option:selected').each(function () {
        obj.push($(this).index());
    });

    for (var i = 0; i < obj.length; i++) {
        $('.SlectBox')[0].sumo.unSelectItem(obj[i]);
    }
});


Share : facebook icon twitter icon
Select a Multi-select DropDown by values with jquery

Select a Multi-select DropDown by values with jquery


By : junfei
Date : March 29 2020, 07:55 AM
may help you . That's because you are overriding previous selected values in each iteration, you should pass an array to the val method, try this:
code :
var vals = [];
for (i=0; i<=data[0].fields['sales_item'].length;i++) {
    vals.push(data[0].fields['sales_item'][i]); 
}

$("#id_deals-sales_item").val(vals);
get values to select in onchange of Multi select box with Jquery

get values to select in onchange of Multi select box with Jquery


By : Leolan
Date : March 29 2020, 07:55 AM
I hope this helps . trying get values to tag values. I have tow dropdown list called vehicle_type and part_type. what i want to do when select the vehicle type and part type need change the part name dropdown list. It is different to vehicle type and part type combination. So I wrote following code. Could some one help me to find the error of this code. And I'm new to jquery , Try This:
code :
<?php
if(isset($_POST['vehicle_type'])&&isset($_POST['part_type'])){

$vehicle_type =$_POST['vehicle_type'];
$part_type    =$_POST['part_type'];

if(($vehicle_type=="Car")&&($part_type=="Engine")){
    $partname  = "<option value=\"Engine Head Block\">Engine Head Block</option>";
    $partname .= "<option value=\"Engine Complete W/O Gear Box\">Engine Complete W/O Gear Box</option>";
    $partname .= "<option value=\"Engine With A/T CVT Gear Box\">Engine With A/T CVT Gear Box</option>";
 } elseif(($vehicle_type=="Car")&&($part_type=="Body")){
    $partname  = "<option value=\"Nose Pannel / Parts\">Nose Pannel / Parts</option>";
    $partname .= "<option value=\"Front Bumper With Fog Lamp L/R\">Front Bumper With Fog Lamp L/R</option>";
    $partname .= "<option value=\"Front Bumper Bracket Retainer L/R\">Front Bumper Bracket Retainer L/R</option>";
 }
 echo $partname;
}
?>
<script type="text/javascript">

function setSelect(vehicle_type, part_type){
//alert(vehicle_type+part_type);
 $.post("dropdown.php",{"vehicle_type":vehicle_type, "part_type":part_type},function(data){
  $("#part_name").html(data);

 });
 }

 $(document).ready(function(){

 $("#vehicle_type").change(function(){
var vehicle = $("option:selected",this).val();

 });

 $("#part_type").change(function(){
 var part = $("option:selected",this).val();   
 setSelect($("#vehicle_type option:selected").val(), $("#part_type option:selected").val());
 });


  });
</script>
How to get final select values from multi-select drop down list Jquery

How to get final select values from multi-select drop down list Jquery


By : mosione70
Date : March 29 2020, 07:55 AM
Hope this helps Here you go:
Demo: JSFiddle
code :
$("#mySelect").on("change",function(){
    var devices = [];
    $('#mySelect :selected').each(function(i, selected){ 
      devices[i] = $(selected).text();
      //OR
      //devices.push($(selected).text()); 
    });
    alert(devices);
});
Accessing to multi selected values in 5 filters - SumoSelect - Ajax - JavaScript - JQuery

Accessing to multi selected values in 5 filters - SumoSelect - Ajax - JavaScript - JQuery


By : AndroidLover
Date : March 29 2020, 07:55 AM
Does that help According to my best understanding by your question, You want to send multi-selected data to server via ajax calls.
For that first you need to serialize your data. eg. for sending multiple states to server you can do something like
code :
state = $('#state').val()
state = JSON.stringify(state)
.....
// send state to server
url = url + "&state=" + state;
...
$state =  $_GET['state'];
$states_array =  json_decode($state);
var_dump($states_array);
How to reset or unselect multi select box using jQuery?

How to reset or unselect multi select box using jQuery?


By : user3298296
Date : March 29 2020, 07:55 AM
will help you You can trigger the click of your reset button and clear the whole div in your document ready function. After this you can remove the class "selected" so its completely reset.
Like this
code :
$(document).ready(function() {
  $('select').multi({
    search_placeholder: 'Search',
  });

  $('#tabReset').click(function() {
    $('.selected-wrapper').empty();
    $('a').removeClass('selected');
  });
});
Related Posts Related Posts :
  • How to get font-size, written in CSS?
  • HTML div becomes hidden when including jqueryUI.js when using JQuery Mobile
  • Why is this jquery easing sample not working in JSFiddle?
  • TabIndex - hitting tab moves me to Address Bar - unable to work around this using Focus
  • Create JSON from string, to use as object
  • Jquery - How do I make ifModified:true work in .ajax request?
  • Jquery and create html on the fly
  • jQuery Validation not validating on button click
  • Jquery Draggable/Droppable appending multiple divs
  • jQuery selector not working properly. Possible Sizzle bug?
  • enable anchor in twitter bootstrap modal
  • jQuery keydown : Wait for previous event to finish
  • why magnific popup ajax box closes if clicked on content
  • JQPlot pie charts "jqplotDataClick" event fires multiple times
  • Show div as the page scrolls on div height
  • Keypress event for ajax call does not work
  • responsive/fluid jQGrid with Twitter Bootstrap
  • IE10 does not seem to fire load event
  • Remove tipTip tool tip
  • jquery datepicker changing unavailable dates in one instance
  • TableTools plugin export buttons are not working
  • Prepopulate jquery token input textbox
  • Open a fancybox link with ajax
  • Getting jQuery and AngularJS content assist / auto-complete in eclipse for standalone HTML "file"
  • TR alternate background colour with unequal number of TD
  • DATATABLE jQuery TH and TD alignment
  • Jquery UI Convert Select's to Range Slider
  • Change text in text field according to link that has been clicked
  • Animate addClass + removeClass transitions?
  • knockout ajax call data-BIND
  • How do I create a variable with a number based on an element's number position using jquery?
  • Prevent fixed position element from flickering during jQuery animation
  • points are not visible clearly in nvd3 ghaph
  • How to write a regular expression for IP address format
  • Animate 3 DIVs from right to left when page is loading.
  • How to pivot columns in free jqgrid 4.15.4
  • the jquery method works fine but when made as a function not working
  • Show/hide text doesn't work when targeting link within div
  • multiple autocomplete search input fields
  • Display image in cell using Jquery jTable
  • jQuery and Wordpress - Scripts not working
  • flickering when mouse over, .hover() show/hide div(s)
  • Using Django's JSONResponseMixin to respond to AJAX requests
  • Unable to render charts using Wicked PDF
  • Style to dynamically created elements
  • hover not working for items in list
  • Keep server session alive automatically based on activity / input, using JQuery
  • jQuery load() taking a long time
  • Change / Exchange values in textboxes on text change in jquery
  • Unslider arrow code overriding slider options
  • what is the traditional way of sorting search results?
  • Do the action when the DIV comes in the display area of the browser with jQuery
  • jQuery slideshow overlapping CSS ribbon
  • JQuery animate function dont work
  • problems charts jquery highcharts
  • css absolute position on top of another element
  • How use jQuery String variable in html body
  • Get a row from table in view on modal bootstrap using codeigniter
  • How to make the effect of a div that covers an other div when scrolling?
  • Data binding using a button
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org