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
|
COTE PAGE
<html>
<head>
<script language="JavaScript">
function deplacer(listeSrc, nomListeDst) {
var listeDst = document.getElementById(nomListeDst);
if (listeSrc.options.selectedIndex >= 0) {
var o = new Option(listeSrc.options[listeSrc.options.selectedIndex].text, listeSrc.options[listeSrc.options.selectedIndex].value);
listeDst.options[listeDst.options.length] = o;
listeSrc.options[listeSrc.options.selectedIndex] = null;
} else {
alert("Aucun utilisateur sélectionné");
}
}
function selectAll()
{
var v = document.forms[0].liste2;
for (var i = 0; i < v.options.length; i++)
{
v.options[i].selected = true;
}
return true;
}
</script>
</head>
<body>
<form action="...???..." method="POST" onsubmit="selectAll()">
<table>
<tr>
<td>
<select name="liste1" id="liste1" size="5" onclick="deplacer(this, 'liste2');">
<option value="1">1- Pierre</option>
<option value="2">2- Paul</option>
<option value="3">3- Jacques</option>
</select>
</td>
<td>
<select name="liste2" id="liste2" size="5" multiple onclick="deplacer(this, 'liste1');" />
</td>
</tr>
</table>
<input type="submit"/>
</form>
</body>
</html>
COTE SERVLET
String[] vSelectionnees = request.getParameterValues("liste2");
... etc |