JavaScript Move items between two ListBoxes in ASP.Net using JQuery move items between sharepoint lists,move items between vaults 1password,

I want to move items between two Listboxes in ASP.Net using JQuery/Javascript and below is my code which is working perfectly.

function AddItems() {
    var totalItemsSelected = 0;
    var CurrentItems = 0;
    var MessageLabel = document.getElementById('<%=lblITProgrammingMessage.ClientID%>');
    var selectedOptions = jQuery('#<%=ListITProgramming.ClientID %> option:selected');

    if (selectedOptions.length == 0) {
        MessageLabel.innerHTML = "Please select skill(s) to add.";
        jQuery('#<%= lblITProgrammingMessage.ClientID %>').fadeOut(2000, function () { MessageLabel.innerHTML = ""; });
        jQuery('#<%= lblITProgrammingMessage.ClientID %>').fadeIn(500, function () { });
        return false;
    }

    jQuery('select[name$=ListMyITProgramming] > option').each(function () { CurrentItems++; });

    if (CurrentItems == 30) {
        MessageLabel.innerHTML = "Maximum limit (30) is reached. You cannot add any more skills.";
        jQuery('#<%= lblITProgrammingMessage.ClientID %>').fadeOut(2000, function () { MessageLabel.innerHTML = ""; });
        jQuery('#<%= lblITProgrammingMessage.ClientID %>').fadeIn(500, function () { });
        return false;
    }

    totalItemsSelected = CurrentItems + selectedOptions.length;

    if (totalItemsSelected > 30) {
        MessageLabel.innerHTML = "You can only select " + (30 - CurrentItems) + " item(s) more.";
        jQuery('#<%= lblITProgrammingMessage.ClientID %>').fadeOut(2000, function () { MessageLabel.innerHTML = ""; });
        jQuery('#<%= lblITProgrammingMessage.ClientID %>').fadeIn(500, function () { });
        return false;
    }

    if (selectedOptions.length == 1) {
        if (jQuery("#<%=ListMyITProgramming.ClientID %> option[value='" + selectedOptions.val() + "']").length > 0) {
        }
        else {
            jQuery('#<%=ListMyITProgramming.ClientID %>').append(jQuery(selectedOptions).clone());
        }
    }
    else if (selectedOptions.length > 1) { jQuery(selectedOptions).each(function () { if (jQuery("#<%=ListMyITProgramming.ClientID %> option[value='" + this.value + "']").length > 0) { } else { jQuery('#<%=ListMyITProgramming.ClientID %>').append(jQuery(this).clone()); } }); }
    jQuery(selectedOptions).remove();

    var hdn2 = "";
    jQuery('select[name$=ListMyITProgramming] > option').each(function () { hdn2 += jQuery(this).attr('value') + ','; });
    jQuery("#<%= listMyITProgrammingValues.ClientID %>").val(hdn2);

    return false;
}

But this code is limited for only one set of ListBoxes as I have hard coded the ListBox names 'ListITProgramming' and 'ListMyITProgramming'.

Can anyone make this dynamic with two parameters in existing function?

Answer:1

I'm trying to do a js app that would basically move some balls on a canvas element. I set the context.fillStyle = "rgba(12, 34, 56, 0.2)"; the problem is that the balls become opaque from transparent ...

I'm trying to do a js app that would basically move some balls on a canvas element. I set the context.fillStyle = "rgba(12, 34, 56, 0.2)"; the problem is that the balls become opaque from transparent ...

I am attempting to write a pair of shaders for WebGL which will allow me to render a color cube. However, when I attempt to open the file, I receive the error "unable to initialize the shader program"...

I am attempting to write a pair of shaders for WebGL which will allow me to render a color cube. However, when I attempt to open the file, I receive the error "unable to initialize the shader program"...

I have a question concerning plugins. I am using the ionic framework (http://ionicframework.com/) and Cordova for my hybrid app. I am using a toast (text popup) plugin to provide some feedback. ...

I have a question concerning plugins. I am using the ionic framework (http://ionicframework.com/) and Cordova for my hybrid app. I am using a toast (text popup) plugin to provide some feedback. ...

  1. cordova ionic plugin keyboard
  2. cordova ionic plugin
  3. cordova ionic plugin webview
  4. cordova ionic plugin_not_installed
  5. cordova ionic plugin camera
  6. ionic cordova plugin remove
  7. ionic cordova plugin add
  8. cordova-plugin-ionic-webview npm
  9. cordova-plugin-ionic-keyboard example
  10. cordova-plugin-ionic@^5.0.0
  11. ionic cordova plugin update
  12. ionic cordova-plugin-whitelist
  13. ionic cordova-plugin-file
  14. ionic cordova plugin list
  15. ionic cordova-plugin-firebase
  16. cordova-plugin-ionic-keyboard npm
  17. ionic cordova-plugin-device
  18. cordova-plugin-ionic-webview example
  19. ionic cordova-plugin-advanced-http
  20. ionic cordova-plugin-googlemaps

I'm writing a google chrome extension to modify the look of tumblr for a project. I'm trying to make the posts to go down in multiple colums rather than just one, It is going... alright. Except as ...

I'm writing a google chrome extension to modify the look of tumblr for a project. I'm trying to make the posts to go down in multiple colums rather than just one, It is going... alright. Except as ...