Monday, August 31, 2009

Multi select transfer using JQuery

JQuery is very good GUI tool
They are many components which can be easily developed by JQuery.
1) Easy Multi Select Transfer from one text box to other can be done ealiy in JQuery.

$().ready(function() {
$('#add').click(function() {
return !$('#select1 option:selected').remove().appendTo('#select2');
});
$('#remove').click(function() {
return !$('#select2 option:selected').remove().appendTo('#select1');
});
});

2) How to find the length of the selected options in the Multi selection
var options = jQuery("#select2 option:selected");
var length = options.length;

No comments: