begin process at 2010 03 20 23:55:17
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Formulaire

 > TRIER UNE LISTE LIÉES PAR 2 AUTRES LISTES À CHOIX MULTIPLE

TRIER UNE LISTE LIÉES PAR 2 AUTRES LISTES À CHOIX MULTIPLE


 Information sur la source

Note :
1 / 10 - par 1 personne
1,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Formulaire Classé sous :liste, choixmultiple, dynamique Niveau :Initié Date de création :23/02/2007 Vu :3 543

Auteur : fabiano13

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Trier une liste liée par 2 autres liste à choix multiples.

PS : je remercie Zobibol et PetoleTeam qui sans eux je ne serai pas arriver à ce résultat !

Fabiano13

Source

  • <HTML>
  • <HEAD>
  • <TITLE></TITLE>
  • <script type="text/javascript">
  • function Supprimer(_id, _type,_ids_1,_ids_2){
  • var ctrl = document.getElementById(_id);
  • if ( ctrl.listChilds == null){
  • ctrl.listChilds = new Array();
  • var ctrlsChilds = ctrl.getElementsByTagName("OPTGROUP");
  • for ( var i = 0; i < ctrlsChilds.length; i++){
  • var clone = ctrlsChilds[i].cloneNode(true);
  • clone._id = clone.id;
  • clone.id =null;
  • var childs = clone.getElementsByTagName ("OPTION");
  • for ( var j = 0; j< childs.length; j++){
  • childs[j]._id = childs[j].id;
  • childs[j].id = null;
  • }
  • ctrl.listChilds.push (clone );
  • }
  • }
  • var typeObj = ctrl.getElementsByTagName (_type);
  • var Lnids_1 = document.getElementById('sFonction').options.length
  • var Lnids_2 = document.getElementById('sSecteur').options.length
  • if((_ids_1.length==Lnids_1)||(_ids_1.length==0)){_ids_1="y".split(",");}
  • if((_ids_2.length==Lnids_2)||(_ids_2.length==0)){_ids_2="x".split(",");}
  • for ( var i =0 ; i < _ids_1.length; i++){
  • for ( var k = 0; k < _ids_2.length; k++){
  • for ( var j = 0; j < typeObj.length; j++){
  • if ((_ids_1[0]!="y")&&(_ids_2[0]!="x")){
  • if ( (typeObj[j].label_1 == _ids_1[i])||(typeObj[j].label_2 == _ids_2[k]) ){typeObj[j].parentNode.removeChild ( typeObj[j] );j--;}
  • }else if (_ids_1[0]=="y"){
  • if ( typeObj[j].label_2 == _ids_2[k] ){typeObj[j].parentNode.removeChild ( typeObj[j] );j--;}
  • }else if (_ids_2[0]=="x"){
  • if ( typeObj[j].label_1 == _ids_1[i] ){typeObj[j].parentNode.removeChild ( typeObj[j] );j--;}
  • }
  • }
  • }
  • }
  • }
  • function Reconstruire(_id){
  • var ctrl = document.getElementById(_id);
  • // réinitialise le composant.
  • ctrl.innerHTML = "";
  • // ajoute tous ces fils
  • for ( var i = 0; i < ctrl.listChilds.length; i++){
  • var ret = ctrl.appendChild ( ctrl.listChilds[i]) ;
  • // réattribut l'id
  • ret.id = ret._id;
  • // fais de même pour ces fils
  • for ( var j = 0; j < ret.childNodes.length; j++){
  • if ( ret.childNodes[j]._id != null )
  • ret.childNodes[j].id = ret.childNodes[j]._id;
  • }
  • }
  • ctrl.listChilds = null;
  • }
  • function Trier(){
  • var selectione_1="";
  • for (i=0; i<document.getElementById('sFonction').options.length; i++) {
  • if (!document.getElementById('sFonction').options[i].selected ) {
  • selectione_1 += "'" + document.getElementById('sFonction').options[i].label_1 + "',"; }
  • }
  • var selectione_2="";
  • for (i=0; i<document.getElementById('sSecteur').options.length; i++) {
  • if (!document.getElementById('sSecteur').options[i].selected ) {
  • selectione_2 += "'" + document.getElementById('sSecteur').options[i].label_2 + "',"; }
  • }
  • var sSelection_1 = selectione_1.substr(0,selectione_1.length - 1)
  • var sSelection_2 = selectione_2.substr(0,selectione_2.length - 1)
  • var ctrl = document.getElementById('sContact');
  • if ( ctrl.listChilds != null){Reconstruire('sContact')}
  • Supprimer('sContact','OPTION',eval("[" + sSelection_1 + "]"),eval("[" + sSelection_2 + "]"))
  • }
  • </script>
  • </HEAD>
  • <BODY>
  • <b>Fonction&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  • Secteur d'activité&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  • Contacts</b><br>
  • <select onchange="Trier();" size=47 id="sFonction" multiple>
  • <optgroup id="Direction" label="Direction" style="background-color:#FFFFAA">
  • <option label_1="label_1_" style="background-color:#FFFFAA">Président Directeur Général</option>
  • <option label_1="label_2_" style="background-color:#FFFFAA">Directeur Général</option>
  • </optgroup>
  • <optgroup id="Marketing" label="Marketing" style="background-color:#AAFFFF">
  • <option label_1="label_3_" style="background-color:#AAFFFF">Directeur Marketing</option>
  • <option label_1="label_4_" style="background-color:#AAFFFF">Chef Produit</option>
  • <option label_1="label_5_" style="background-color:#AAFFFF">Assitant Marketing</option>
  • <option label_1="label_6_" style="background-color:#AAFFFF">Responsable Licence</option>
  • </optgroup>
  • <optgroup id="PAO" label="PAO" style="background-color:#FFAAFF">
  • <option label_1="label_7_" style="background-color:#FFAAFF">Directeur de Création</option>
  • <option label_1="label_8_" style="background-color:#FFAAFF">Directeur Artistique</option>
  • <option label_1="label_9_" style="background-color:#FFAAFF">Graphiste</option>
  • </optgroup>
  • </select>
  • <select onchange="Trier();" size=47 id="sSecteur" multiple>
  • <optgroup id="Agro-Alimentaire" label="Agro-Alimentaire" style="background-color:#FF8A8A">
  • <option label_2="label_1_" style="background-color:#FF8A8A">Boisson</option>
  • <option label_2="label_2_" style="background-color:#FF8A8A">Biscuiterie</option>
  • </optgroup>
  • <optgroup id="Service" label="Service" style="background-color:#CAFF95">
  • <option label_2="label_3_" style="background-color:#CAFF95">Agence Communication</option>
  • <option label_2="label_4_" style="background-color:#CAFF95">Agence Conseil</option>
  • <option label_2="label_5_" style="background-color:#CAFF95">Agence Promotion</option>
  • <option label_2="label_6_" style="background-color:#CAFF95">Agence Créative</option>
  • </optgroup>
  • <optgroup id="Industrie" label="Industrie" style="background-color:#A8CBFF">
  • <option label_2="label_7_" style="background-color:#A8CBFF">Chimique</option>
  • <option label_2="label_8_" style="background-color:#A8CBFF">Pétrol</option>
  • <option label_2="label_9_" style="background-color:#A8CBFF">Papéterie</option>
  • </optgroup>
  • </select>
  • <select size=47 id="sContact" multiple>
  • <optgroup id="Client" label="Client" style="background-color:#D7EBFF">
  • <option label_1="label_3_" label_2="label_1_" id="id_1_" style="background-color:#D7EBFF">Guillermo Alcaide (Directeur Marketing - Boisson)</option>
  • <option label_1="label_4_" label_2="label_3_" id="id_2_" style="background-color:#D7EBFF">Thomas Leleu (Chef Produit - Agence Communication)</option>
  • <option label_1="label_2_" label_2="label_6_" id="id_3_" style="background-color:#D7EBFF">Alexandre Penaud (Directeur Général - Agence Créative)</option>
  • <option label_1="label_1_" label_2="label_3_" id="id_4_" style="background-color:#D7EBFF">Julien Obry (Président Directeur Général - Agence Communication)</option>
  • <option label_1="label_5_" label_2="label_8_" id="id_5_" style="background-color:#D7EBFF">Nathan Martinet (Assitant Marketing - Pétrol)</option>
  • <option label_1="label_3_" label_2="label_3_" id="id_6_" style="background-color:#D7EBFF">Laurent Bram (Directeur Marketing - Agence Communication)</option>
  • <option label_1="label_6_" label_2="label_5_" id="id_7_" style="background-color:#D7EBFF">Vincent Boginoff (Responsable Licence - Agence Promotion)</option>
  • <option label_1="label_1_" label_2="label_2_" id="id_8_" style="background-color:#D7EBFF">Mathieu Guenat (Président Directeur Général - Biscuiterie)</option>
  • <option label_1="label_8_" label_2="label_4_" id="id_9_" style="background-color:#D7EBFF">Jonathan Dahan (Directeur Artistique - Agence Conseil)</option>
  • <option label_1="label_2_" label_2="label_6_" id="id_10_" style="background-color:#D7EBFF">Christophe Lenzi (Directeur Général - Agence Créative)</option>
  • <option label_1="label_1_" label_2="label_5_" id="id_11_" style="background-color:#D7EBFF">Adrien Gombocz (Président Directeur Général - Agence Promotion)</option>
  • <option label_1="label_9_" label_2="label_1_" id="id_12_" style="background-color:#D7EBFF">Romain Sichez (Graphiste - Boisson)</option>
  • <option label_1="label_5_" label_2="label_2_" id="id_13_" style="background-color:#D7EBFF">Nicolas Tholozan (Assitant Marketing - Biscuiterie)</option>
  • </optgroup>
  • <optgroup id="Utilisateur" label="Utilisateur" style="background-color:#DED8E9">
  • <option label_1="label_3_" label_2="label_4_" id="id_14_" style="background-color:#DED8E9">Antoine Hamard (Directeur Marketing - Agence Conseil)</option>
  • <option label_1="label_2_" label_2="label_3_" id="id_15_" style="background-color:#DED8E9">Alexis Klegou (Directeur Général - Agence Communication)</option>
  • <option label_1="label_7_" label_2="label_7_" id="id_16_" style="background-color:#DED8E9">Vincent Dubosclard (Directeur de Création - Chimique)</option>
  • <option label_1="label_1_" label_2="label_1_" id="id_17_" style="background-color:#DED8E9">Luca Rovetta (Président Directeur Général - Boisson)</option>
  • <option label_1="label_8_" label_2="label_2_" id="id_18_" style="background-color:#DED8E9">Robert Khoury (Directeur Artistique - Biscuiterie)</option>
  • <option label_1="label_4_" label_2="label_6_" id="id_19_" style="background-color:#DED8E9">Arthur Surreaux (Chef Produit - Agence Créative)</option>
  • <option label_1="label_6_" label_2="label_1_" id="id_20_" style="background-color:#DED8E9">Hakim Rezgui (Responsable Licence - Boisson)</option>
  • <option label_1="label_3_" label_2="label_5_" id="id_21_" style="background-color:#DED8E9">Laurent Bondaz (Directeur Marketing - Agence Promotion)</option>
  • <option label_1="label_3_" label_2="label_2_" id="id_22_" style="background-color:#DED8E9">Thomas van Cauter (Directeur Marketing - Biscuiterie)</option>
  • <option label_1="label_9_" label_2="label_1_" id="id_23_" style="background-color:#DED8E9">Boris Obama (Graphiste - Boisson)</option>
  • <option label_1="label_7_" label_2="label_8_" id="id_24_" style="background-color:#DED8E9">Yannick Thomet (Directeur de Création - Pétrol)</option>
  • <option label_1="label_1_" label_2="label_9_" id="id_25_" style="background-color:#DED8E9">Benoit Bottero (Président Directeur Général - Papéterie)</option>
  • <option label_1="label_5_" label_2="label_9_" id="id_26_" style="background-color:#DED8E9">Benjamin Cselenko (Assitant Marketing - Papéterie)</option>
  • <option label_1="label_1_" label_2="label_4_" id="id_27_" style="background-color:#DED8E9">Hugo Vouillat (Président Directeur Général - Agence Conseil)</option>
  • <option label_1="label_6_" label_2="label_3_" id="id_28_" style="background-color:#DED8E9">Kristof de Leeuw (Responsable Licence - Agence Communication)</option>
  • <option label_1="label_4_" label_2="label_8_" id="id_29_" style="background-color:#DED8E9">Mark de Jong (Chef Produit - Pétrol)</option>
  • <option label_1="label_2_" label_2="label_5_" id="id_30_" style="background-color:#DED8E9">Sliman Taghzouit (Directeur Général - Agence Promotion)</option>
  • <option label_1="label_9_" label_2="label_7_" id="id_31_" style="background-color:#DED8E9">Boris Oumow (Graphiste - Chimique)</option>
  • <option label_1="label_7_" label_2="label_1_" id="id_32_" style="background-color:#DED8E9">Teddy Ranghella (Directeur de Création - Boisson)</option>
  • </optgroup>
  • <optgroup id="Visiteur" label="Visiteur" style="background-color:#FFD393">
  • <option label_1="label_5_" label_2="label_9_" id="id_33_" style="background-color:#FFD393">Konstantinos Kalaitzis (Assitant Marketing - Papéterie)</option>
  • <option label_1="label_2_" label_2="label_8_" id="id_34_" style="background-color:#FFD393">Yannick Thivant (Directeur Général - Pétrol)</option>
  • <option label_1="label_1_" label_2="label_6_" id="id_35_" style="background-color:#FFD393">Bilo Katis (Président Directeur Général - Agence Créative)</option>
  • <option label_1="label_7_" label_2="label_3_" id="id_36_" style="background-color:#FFD393">Benoit Viant(Directeur de Création - Agence Communication)</option>
  • <option label_1="label_3_" label_2="label_6_" id="id_37_" style="background-color:#FFD393">Gérôme Landin (Directeur Marketing - Agence Créative)</option>
  • <option label_1="label_2_" label_2="label_5_" id="id_38_" style="background-color:#FFD393">Didier Ouzer (Directeur Général - Agence Promotion)</option>
  • <option label_1="label_6_" label_2="label_4_" id="id_39_" style="background-color:#FFD393">Armando Gijon (Responsable Licence - Agence Conseil)</option>
  • <option label_1="label_2_" label_2="label_2_" id="id_40_" style="background-color:#FFD393">Daniel Cousin (Directeur Général - Biscuiterie)</option>
  • </optgroup>
  • </select></BODY></HTML>
<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript">
            
function Supprimer(_id, _type,_ids_1,_ids_2){
  var ctrl = document.getElementById(_id);
    if ( ctrl.listChilds == null){
            ctrl.listChilds = new Array();
            var ctrlsChilds = ctrl.getElementsByTagName("OPTGROUP");
            for ( var i = 0; i < ctrlsChilds.length; i++){
                    var clone = ctrlsChilds[i].cloneNode(true);
                    clone._id = clone.id;
                    clone.id =null;
                    var childs = clone.getElementsByTagName ("OPTION");
                    for ( var j = 0;  j< childs.length; j++){
                            childs[j]._id = childs[j].id;
                            childs[j].id = null;
                    }
                    ctrl.listChilds.push (clone );
            }
    }
  var typeObj = ctrl.getElementsByTagName (_type);
  var Lnids_1 = document.getElementById('sFonction').options.length
  var Lnids_2 = document.getElementById('sSecteur').options.length
  
  if((_ids_1.length==Lnids_1)||(_ids_1.length==0)){_ids_1="y".split(",");}
  if((_ids_2.length==Lnids_2)||(_ids_2.length==0)){_ids_2="x".split(",");}

   for ( var i =0 ; i < _ids_1.length; i++){
      for ( var k = 0; k < _ids_2.length; k++){
        for ( var j = 0; j < typeObj.length; j++){

if ((_ids_1[0]!="y")&&(_ids_2[0]!="x")){
  if ( (typeObj[j].label_1 == _ids_1[i])||(typeObj[j].label_2 == _ids_2[k]) ){typeObj[j].parentNode.removeChild ( typeObj[j] );j--;}
}else if (_ids_1[0]=="y"){
  if ( typeObj[j].label_2 == _ids_2[k] ){typeObj[j].parentNode.removeChild ( typeObj[j] );j--;}
}else if (_ids_2[0]=="x"){
  if ( typeObj[j].label_1 == _ids_1[i] ){typeObj[j].parentNode.removeChild ( typeObj[j] );j--;}
}

         }
      }
   }
}

function Reconstruire(_id){
    var ctrl = document.getElementById(_id);
    // réinitialise le composant.
    ctrl.innerHTML = "";
    // ajoute tous ces fils
  for ( var i = 0; i < ctrl.listChilds.length; i++){
             var ret = ctrl.appendChild ( ctrl.listChilds[i]) ;
            // réattribut l'id
            ret.id = ret._id;
            // fais de même pour ces fils
            for ( var j = 0; j < ret.childNodes.length; j++){
                if ( ret.childNodes[j]._id != null )
                    ret.childNodes[j].id = ret.childNodes[j]._id;
            }
    }
    ctrl.listChilds = null;
}

function Trier(){
var selectione_1=""; 
for (i=0; i<document.getElementById('sFonction').options.length; i++) { 
if (!document.getElementById('sFonction').options[i].selected ) { 
      selectione_1 += "'" + document.getElementById('sFonction').options[i].label_1 + "',";  }
}

var selectione_2=""; 
for (i=0; i<document.getElementById('sSecteur').options.length; i++) { 
if (!document.getElementById('sSecteur').options[i].selected ) { 
      selectione_2 += "'" + document.getElementById('sSecteur').options[i].label_2 + "',";  }
}

var sSelection_1 = selectione_1.substr(0,selectione_1.length - 1)
var sSelection_2 = selectione_2.substr(0,selectione_2.length - 1)

var ctrl = document.getElementById('sContact');
if ( ctrl.listChilds != null){Reconstruire('sContact')}

Supprimer('sContact','OPTION',eval("[" + sSelection_1 + "]"),eval("[" + sSelection_2 + "]"))
}



</script>
</HEAD>
<BODY>
<b>Fonction&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Secteur d'activité&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Contacts</b><br>
<select onchange="Trier();" size=47 id="sFonction" multiple>
    <optgroup id="Direction" label="Direction" style="background-color:#FFFFAA">
        <option label_1="label_1_" style="background-color:#FFFFAA">Président Directeur Général</option>
        <option label_1="label_2_" style="background-color:#FFFFAA">Directeur Général</option>
    </optgroup>
    <optgroup   id="Marketing" label="Marketing" style="background-color:#AAFFFF">
        <option label_1="label_3_" style="background-color:#AAFFFF">Directeur Marketing</option>
        <option label_1="label_4_" style="background-color:#AAFFFF">Chef Produit</option>
        <option label_1="label_5_" style="background-color:#AAFFFF">Assitant Marketing</option>
        <option label_1="label_6_" style="background-color:#AAFFFF">Responsable Licence</option>
    </optgroup>
    <optgroup   id="PAO" label="PAO" style="background-color:#FFAAFF">
        <option label_1="label_7_" style="background-color:#FFAAFF">Directeur de Création</option>
        <option label_1="label_8_" style="background-color:#FFAAFF">Directeur Artistique</option>
        <option label_1="label_9_" style="background-color:#FFAAFF">Graphiste</option>
    </optgroup>
</select>
<select onchange="Trier();" size=47 id="sSecteur" multiple>
    <optgroup id="Agro-Alimentaire" label="Agro-Alimentaire" style="background-color:#FF8A8A">
        <option label_2="label_1_" style="background-color:#FF8A8A">Boisson</option>
        <option label_2="label_2_" style="background-color:#FF8A8A">Biscuiterie</option>
    </optgroup>
    <optgroup   id="Service" label="Service" style="background-color:#CAFF95">
        <option label_2="label_3_" style="background-color:#CAFF95">Agence Communication</option>
        <option label_2="label_4_" style="background-color:#CAFF95">Agence Conseil</option>
        <option label_2="label_5_" style="background-color:#CAFF95">Agence Promotion</option>
        <option label_2="label_6_" style="background-color:#CAFF95">Agence Créative</option>
    </optgroup>
    <optgroup   id="Industrie" label="Industrie" style="background-color:#A8CBFF">
        <option label_2="label_7_" style="background-color:#A8CBFF">Chimique</option>
        <option label_2="label_8_" style="background-color:#A8CBFF">Pétrol</option>
        <option label_2="label_9_" style="background-color:#A8CBFF">Papéterie</option>
    </optgroup>
</select>

<select size=47 id="sContact" multiple>
    <optgroup   id="Client" label="Client" style="background-color:#D7EBFF">
        <option label_1="label_3_" label_2="label_1_" id="id_1_" style="background-color:#D7EBFF">Guillermo Alcaide (Directeur Marketing - Boisson)</option>
        <option label_1="label_4_" label_2="label_3_" id="id_2_" style="background-color:#D7EBFF">Thomas Leleu (Chef Produit - Agence Communication)</option>
        <option label_1="label_2_" label_2="label_6_" id="id_3_" style="background-color:#D7EBFF">Alexandre Penaud (Directeur Général - Agence Créative)</option>
        <option label_1="label_1_" label_2="label_3_" id="id_4_" style="background-color:#D7EBFF">Julien Obry (Président Directeur Général - Agence Communication)</option>
        <option label_1="label_5_" label_2="label_8_" id="id_5_" style="background-color:#D7EBFF">Nathan Martinet (Assitant Marketing - Pétrol)</option>
        <option label_1="label_3_" label_2="label_3_" id="id_6_" style="background-color:#D7EBFF">Laurent Bram (Directeur Marketing - Agence Communication)</option>
        <option label_1="label_6_" label_2="label_5_" id="id_7_" style="background-color:#D7EBFF">Vincent Boginoff (Responsable Licence - Agence Promotion)</option>
        <option label_1="label_1_" label_2="label_2_" id="id_8_" style="background-color:#D7EBFF">Mathieu Guenat (Président Directeur Général - Biscuiterie)</option>
        <option label_1="label_8_" label_2="label_4_" id="id_9_" style="background-color:#D7EBFF">Jonathan Dahan (Directeur Artistique - Agence Conseil)</option>
        <option label_1="label_2_" label_2="label_6_" id="id_10_" style="background-color:#D7EBFF">Christophe Lenzi (Directeur Général - Agence Créative)</option>
        <option label_1="label_1_" label_2="label_5_" id="id_11_" style="background-color:#D7EBFF">Adrien Gombocz (Président Directeur Général - Agence Promotion)</option>
        <option label_1="label_9_" label_2="label_1_" id="id_12_" style="background-color:#D7EBFF">Romain Sichez (Graphiste - Boisson)</option>
        <option label_1="label_5_" label_2="label_2_" id="id_13_" style="background-color:#D7EBFF">Nicolas Tholozan (Assitant Marketing - Biscuiterie)</option>
    </optgroup>
    <optgroup   id="Utilisateur" label="Utilisateur" style="background-color:#DED8E9">
        <option label_1="label_3_" label_2="label_4_" id="id_14_" style="background-color:#DED8E9">Antoine Hamard (Directeur Marketing - Agence Conseil)</option>
        <option label_1="label_2_" label_2="label_3_" id="id_15_" style="background-color:#DED8E9">Alexis Klegou (Directeur Général - Agence Communication)</option>
        <option label_1="label_7_" label_2="label_7_" id="id_16_" style="background-color:#DED8E9">Vincent Dubosclard (Directeur de Création - Chimique)</option>
        <option label_1="label_1_" label_2="label_1_" id="id_17_" style="background-color:#DED8E9">Luca Rovetta (Président Directeur Général - Boisson)</option>
        <option label_1="label_8_" label_2="label_2_" id="id_18_" style="background-color:#DED8E9">Robert Khoury (Directeur Artistique - Biscuiterie)</option>
        <option label_1="label_4_" label_2="label_6_" id="id_19_" style="background-color:#DED8E9">Arthur Surreaux (Chef Produit - Agence Créative)</option>
        <option label_1="label_6_" label_2="label_1_" id="id_20_" style="background-color:#DED8E9">Hakim Rezgui (Responsable Licence - Boisson)</option>
        <option label_1="label_3_" label_2="label_5_" id="id_21_" style="background-color:#DED8E9">Laurent Bondaz (Directeur Marketing - Agence Promotion)</option>
        <option label_1="label_3_" label_2="label_2_" id="id_22_" style="background-color:#DED8E9">Thomas van Cauter (Directeur Marketing - Biscuiterie)</option>
        <option label_1="label_9_" label_2="label_1_" id="id_23_" style="background-color:#DED8E9">Boris Obama (Graphiste - Boisson)</option>
        <option label_1="label_7_" label_2="label_8_" id="id_24_" style="background-color:#DED8E9">Yannick Thomet (Directeur de Création - Pétrol)</option>
        <option label_1="label_1_" label_2="label_9_" id="id_25_" style="background-color:#DED8E9">Benoit Bottero (Président Directeur Général - Papéterie)</option>
        <option label_1="label_5_" label_2="label_9_" id="id_26_" style="background-color:#DED8E9">Benjamin Cselenko (Assitant Marketing - Papéterie)</option>
        <option label_1="label_1_" label_2="label_4_" id="id_27_" style="background-color:#DED8E9">Hugo Vouillat (Président Directeur Général - Agence Conseil)</option>
        <option label_1="label_6_" label_2="label_3_" id="id_28_" style="background-color:#DED8E9">Kristof de Leeuw (Responsable Licence - Agence Communication)</option>
        <option label_1="label_4_" label_2="label_8_" id="id_29_" style="background-color:#DED8E9">Mark de Jong (Chef Produit - Pétrol)</option>
        <option label_1="label_2_" label_2="label_5_" id="id_30_" style="background-color:#DED8E9">Sliman Taghzouit (Directeur Général - Agence Promotion)</option>
        <option label_1="label_9_" label_2="label_7_" id="id_31_" style="background-color:#DED8E9">Boris Oumow (Graphiste - Chimique)</option>
        <option label_1="label_7_" label_2="label_1_" id="id_32_" style="background-color:#DED8E9">Teddy Ranghella (Directeur de Création - Boisson)</option>
    </optgroup>
    <optgroup  id="Visiteur" label="Visiteur" style="background-color:#FFD393">
        <option label_1="label_5_" label_2="label_9_" id="id_33_" style="background-color:#FFD393">Konstantinos Kalaitzis (Assitant Marketing - Papéterie)</option>
        <option label_1="label_2_" label_2="label_8_" id="id_34_" style="background-color:#FFD393">Yannick Thivant (Directeur Général - Pétrol)</option>
        <option label_1="label_1_" label_2="label_6_" id="id_35_" style="background-color:#FFD393">Bilo Katis (Président Directeur Général - Agence Créative)</option>
        <option label_1="label_7_" label_2="label_3_" id="id_36_" style="background-color:#FFD393">Benoit Viant(Directeur de Création - Agence Communication)</option>
        <option label_1="label_3_" label_2="label_6_" id="id_37_" style="background-color:#FFD393">Gérôme Landin (Directeur Marketing - Agence Créative)</option>
        <option label_1="label_2_" label_2="label_5_" id="id_38_" style="background-color:#FFD393">Didier Ouzer (Directeur Général - Agence Promotion)</option>
        <option label_1="label_6_" label_2="label_4_" id="id_39_" style="background-color:#FFD393">Armando Gijon (Responsable Licence - Agence Conseil)</option>
        <option label_1="label_2_" label_2="label_2_" id="id_40_" style="background-color:#FFD393">Daniel Cousin (Directeur Général - Biscuiterie)</option>
    </optgroup>
</select></BODY></HTML>



 Sources du même auteur

TRIER UNE LISTE À CHOIX MULTIPLES LIÉES PAR DES LABELS

 Sources de la même categorie

DÉSACTIVER UN BOUTON SUBMIT APRÈS ENVOI DU FORMULAIRE par SoftDeath
IMPLEMENTATION DE RANDOM PERSONNALISÉ par ousous
IMPLEMENTATION DE HASHTABLE par ousous
JAVASCRIPT.UTIL.ITERATOR par ousous
Source avec Zip Source avec une capture PALETTE DE COULEURS par titnome

 Sources en rapport avec celle ci

Source avec une capture CHARGER UNE PAGE WEB DANS UN DIV par flk974
RETROUVER LE NUMÉROS DE TELEPHONE DE VOTRE EMPLOYER RAPIDEME... par rappise
Source avec Zip Source avec une capture TABLEAU GÉNÉRÉ ET TRIÉ PAR LE CLIENT par Klephte
Source avec Zip TRI DÉCROISSANT ET CROISSANT D'UN TABLEAU DYNAMIQUE REMPLIE ... par barbe91
TRIER UNE LISTE À CHOIX MULTIPLES LIÉES PAR DES LABELS par fabiano13

Commentaires et avis

Commentaire de Mamoune2005 le 26/02/2007 13:10:56

Dommage que ça ne marche que sous IE et donc assez inutilisable !

Commentaire de PetoleTeam le 27/02/2007 17:21:21

Bonjour,
pour rendre compatible DOM en fait peut de chose à changer...
il faut utiliser la méthode getAttribute() pour récuperer les label_1 et label_2
la fonction Trier pourrait ressembler à cela

function Trier(){
  var selectione_1="";
  var selectione_2="";
  var Obj = null;

  Obj = document.getElementById('sFonction');
  for (i=0; i< Obj.options.length; i++) {
    if(! Obj.options[i].selected ) {
      selectione_1 += "'" + Obj.options[i].getAttribute('label_1') + "',";
    }
  }

  Obj = document.getElementById('sSecteur');
  for (i=0; i< Obj.options.length; i++) {
    if (!Obj.options[i].selected ) {
      selectione_2 += "'" + Obj.options[i].label_2 + "',";  }
    }

...puis la suite...

il faut faire de même dans la fonction Supprimer
;0)

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Creation liste dynamique php [ par houloul1 ] Bonjour à tous ,et merci d'avoir pris le temps de lire ce message.Mon souci est le suivant :je voudrai qu'apres avoir saisi un code postal cela affich Filtre dynamique ... [ par Hector78 ] Hello !Je cherche un script me permettant de filtrer dynamiquement des donn&#233;es &#224; l'aide d'une combobox. (ex. liste de membres, filtrer les h formulaire dynamique [ par refkaben ] Bonjour et meilleurs voeux pour&nbsp;tout monde.&nbsp;Je veux faire un formulaire dont les champs s'ajoute en cliquant sur un bouton.J'ai cr&#233;&#23 Checkbox et formulaire dynamique [ par petitelarve ] bonjour, Je cherche un moyen d'afficher des liste &lt;select&gt; et  des textearea suite au check sur une checkbox.Par exemble , si on click sur la ch liste dynamique [ par lenglais2001 ] Mon code javascript d'affichage de liste dynamique ne fonctionne pas sous IE alors qu'il fonctionne sous Firefox!je ne comprends pas pourquoi:&lt;scri Formulaire dynamique [ par zebu238 ] Bonjour à tous ,et merci d'avoir pris le temps de lire ce message.Mon souci est le suivant :je voudrai qu'apres avoir saisi un code postal cela affich PHP/Javascipt et formulaire dynamique [ par tiquisrd ] Bonjour, je suis entrain de monter une page PHP avec un formulaire qui contient, entre autre, une liste de départements (requête PHP/MySQL). Je souhai Liste déroulante dynamique PHP/AJAX [ par Vins974 ] Bonjour à tous !!! J'ai besoin de votre aide svp .. Je crée un site , et j'ai besoin d'insérer 3 listes déroulantes dynamiques. Je m'explique <img sr Problème javascript + liste déroulante + requête SQL [ par exorzist ] Bonjour, voilà je suis bloqué depuis un bon moment maintenant:en fait je veux pouvoir, au changement dans une liste déroulante, récupérer son value af Urgent problème en javascript [ par GaL34 ] Bonjour, je suis actuellement en stage de 2ème année de bts informatique et étant vraiment nul en javascript (mon maitre de stage ma dit de faire ce q


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,702 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales