»
AnglaisFran�aisVietnamien

Imprimer - Liste des objets Popup script - JavaScriptBank.com

Version compl�te: jsB@nk » Utilitaire » Liste des objets Popup script
URL: https://www.javascriptbank.com/items-popup-list-script.html

Liste des objets Popup script © JavaScriptBank.comSi vous avez plusieurs objets à l'utilisateur de choisir à partir de, mai, vous remarquez que votre page devient vite encombré. Cet JavaScript permet de résoudre ce problème en ouvrant un nouveau fenêtre lorsque l'utilisateur veut ajouter des éléments à la liste. La nouvelle fenêtre affiche les points et passe pour l'élément sélectionné d'informations Retour à la liste dans la fenêtre principale. Slick!

Version compl�te: jsB@nk » Utilitaire » Liste des objets Popup script
URL: https://www.javascriptbank.com/items-popup-list-script.html



JavaScript
<SCRIPT LANGUAGE="JavaScript">// Pankaj Mittal ([email protected])<!-- Beginfunction small_window(myurl) {var newWindow;var props = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=300,height=200';newWindow = window.open(myurl, "Add_from_Src_to_Dest", props);}// Adds the list of selected items selected in the child// window to its list. It is called by child window to do so.  function addToParentList(sourceList) {destinationList = window.document.forms[0].parentList;for(var count = destinationList.options.length - 1; count >= 0; count--) {destinationList.options[count] = null;}for(var i = 0; i < sourceList.options.length; i++) {if (sourceList.options[i] != null)destinationList.options[i] = new Option(sourceList.options[i].text, sourceList.options[i].value );   }}// Marks all the items as selected for the submit button.  function selectList(sourceList) {sourceList = window.document.forms[0].parentList;for(var i = 0; i < sourceList.options.length; i++) {if (sourceList.options[i] != null)sourceList.options[i].selected = true;}return true;}// Deletes the selected items of supplied list.function deleteSelectedItemsFromList(sourceList) {var maxCnt = sourceList.options.length;for(var i = maxCnt - 1; i >= 0; i--) {if ((sourceList.options[i] != null) && (sourceList.options[i].selected == true)) {sourceList.options[i] = null;      }   }}//  End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form method=post><table border=1 bgcolor="#ffffcc"><tr><td><select size=5 name=parentList multiple></select></td></tr><tr><td align=center><input type=button value="Add Item" onclick = "javascript:small_window('modify.html');"><input type=button value="Delete Item" onclick = "javascript:deleteSelectedItemsFromList(parentList);"></td></tr></table></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->