Bonjour à toutes et tous,

J'ai trouvé un script répondant à mes besoins ici.

Mais je n'arrive à récupérer que le dernier élément sélectionné dans la liste de droite

J'ai essayé plusieurs solutions et à priori, je pense qu'il faudrait réussir à déclarer la liste de droite en tableau ... Mais l'ajout de [] à listRight empêche le script de fonctionner...
Pour info : la page de sélection
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>moveDualList TEST</title>
<script type="text/javascript" src="moveDualList.js" ></script>
</head>
 
<body>
 
 
 
 
<!-- TEST DUAL LIST -->
 
<form action="mdl-TraitementData.php" method="post" name="">
<table>
	<tr>
		<td>
<!-- Multiple Select List with 20 rows size and 70 pixels wide -->
<!-- Using   for SPACING and alignment -->
		<select multiple size="20" style="width:150px;" name="listLeft">
<?php
include('../includes/fonctions.php');
connexionDataBase();
$sql ="SELECT nodep, departement FROM departement ORDER BY nodep";
$res = mysql_query($sql);
while ($data = mysql_fetch_array($res)) {
?>
		<option value="<?php echo $data['nodep']." ".$data['departement']; ?>"><?php echo $data['nodep']." ".$data['departement']; ?></option>
<?php } ?>
		</select>
		</td>
 		<td> 
		<input type="button" style="width:90px" onclick="moveDualList( this.form.listLeft,  this.form.listRight, false )" name="Ajouter"  value="Ajouter &gt;" id="Ajouter"><br />  
		<input type="button" style="width:90px" onclick="moveDualList( this.form.listRight, this.form.listLeft,  false )" name="enlever"  value="&lt; Enlever" id="enlever"><br />  	
		<!--
        <input type="button" style="width:90px" onclick="moveDualList( this.form.listLeft,  this.form.listRight, true  )" name="Add All>>"  value="Add All >>"><br />
    	<input type="button" style="width:90px" onclick="moveDualList( this.form.listRight, this.form.listLeft,  true  )" name="Add All <<"  value="Add All <<"><br />
        -->
		</td>
  		<td>
		<select multiple size="20" style="width:150px" name="listRight">
 
    	</select>
		</td>
	</tr>
    <tr>
    	<td>&nbsp;</td>
   	  	<td><input name="Envoyer" type="submit" style="width:90px" id="enregistrer" value="Enregistrer" /></td>
   	  	<td>&nbsp;</td>
    </tr>
</table>
 
</form>
 
 
 
 
 
<p>
Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a>
</p>
 
 
</body>
</html>
et la page ou je récupère (pas toutes) les données
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
include('../includes/fonctions.php');
connexionDataBase();
 
	// if (!is_array($_POST['listRight']))   echo " \$_POST['listRight'] n'est pas un tableau <br> \n";  (réponse = n'est pas un tableau)
 
	if(isset($_POST['listRight']) && !empty($_POST['listRight'])){
	$array = $_POST['listRight'];
	print_r($array);
        foreach($array as $selectValue){
        echo $selectValue."<br />";
		}
	}
 
 
 
 
	//$sql = "INSERT etc.
?>
Vous savez tout ... Merci de votre aide, j'ai besoin de ce truc de façon urgente.