Join Easy-Forex, THE site for forex trading. Best Website for hosting
Download Forex Joe's Free Book
You Know Free Practice Trading Account,Trading Forex A currency trade is the simultaneous buying of one currency and selling of another one. The currency combination used in the trade is called a cross (for example, the euro/US dollar, or the GB pound/Japanese yen.). The most commonly traded currencies are the so-called "majors" – EURUSD, USDJPY, USDCHF and GBPUSD.

Multi Select List Add/Remove Item issue in jquery

Jquery code is as follow:
 
$('#addPop').click(function () {
  if ($('#distriList option:selected').val() != null) {
  var tempSelect = $('#distriList option:selected').val();
  $('#distriList option:selected').remove().appendTo('#selectDistriList');
  $("#distriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
  $("#selectDistriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
  $("#selectDistriList").val(tempSelect);
  tempSelect = '';
  } else {
  alert("Before add please select any position.");
  }
  });
 $('#removePop').click(function () {
  if ($('#selectDistriList option:selected').val() != null) {
  var tempSelect = $('#selectDistriList option:selected').val();
  $('#selectDistriList option:selected').remove().appendTo('#distriList');
  $("#selectDistriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
  $("#distriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
 $("#distriList").val(tempSelect);
  tempSelect = '';
  } else {
  alert("Before remove please select any position.");
  }
  });

Form:
<div class="row">
<div  class="col-sm-5">
<select id="distriList" name="distriList" multiple="multiple" class="form-control">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
</div>
<div  class="col-sm-2"> 

<a href="javascript:void(0);" id="addPop" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span></a>
<a href="javascript:void(0);" id="removePop" class="btn btn-danger"><span class="glyphicon glyphicon-minus"></span></a>
</div>
<div  class="col-sm-5">
<select id="selectDistriList" name="selectDistriList" multiple="multiple" class="form-control">
<option value="E">E</option>
<option value="F">F</option>
<option value="G">G</option>
<option value="H">H</option>
</select>
</div>
</div>

Related Posts by Categories



U want get it? click here | Yul Jet

Comments :

0 comments to “Multi Select List Add/Remove Item issue in jquery”

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

 

Blogger Torturial

Visitor From...

Followers

Copyright © 2009 by Blogger Torturial , Help Blogger , Fixs Blogger, Techlogy today

Join Easy-Forex, THE site for forex trading. Best Website for hosting
Download Forex Joe's Free Book
Template by Blog Templste 4 U | Blogspot Tutorial