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 69 70 71 72 73 74 75 76
|
<html>
<head>
<script type="text/JavaScript">
function ajout(listeDep){
var existe = 0;
if(listeDep.options[listeDep.selectedIndex].value == 0){
}
else{
for(i=1;i< document.getElementById('arrive').length ;i++){
if(document.getElementById('arrive').options[i].text == \
listeDep.options[listeDep.selectedIndex].text){
existe = 1;
}
else{
if(existe == 1){
existe = 1;
}
else{
existe = 0;
}
}
}
if(existe == 0){
var option = new Option(listeDep.options[listeDep.selectedIndex].\
text,listeDep.options[listeDep.selectedIndex].value);
document.getElementById('arrive').options[0].text = \
"-- Liste des clients séléctionnés --";
document.getElementById('arrive').options[0].value = 0;
document.getElementById('arrive').options[(document.\
getElementById('arrive').length)] = option;
}
else{
alert('Cette option est déjà séléctionnée !!!');
}
}
}
function enleve(listeArr){
if(listeArr.options[listeArr.selectedIndex].value == 0){
}
else{
listeArr.options[listeArr.selectedIndex] = null;
}
}
</script>
</head>
<body>
<table width='90%'>
<tr>
<td>
<select name='depart' size='5' ondblclick='ajout(this)' style="scrollbar-3dlight-color:red; border: red 1px solid; BACKGROUND-COLOR: #f2f2f2">
<option value='0'>
Double clic pour sélectionner un client
</option>
<option value='1'>Option 1</option>
<option value='2'>Option 2</option>
<option value='3'>Option 3</option>
<option value='4'>Option 4</option>
</select>
</td>
<td>
<select name='arrive' id='arrive' size='5' ondblclick="enleve(this);"
style="scrollbar-3dlight-color:red; border: red 1px solid; BACKGROUND-COLOR: #f2f2f2">
<option value='0'>
Aucune option n'est séléctionnée !!!
</option>
</select>
</td>
</tr>
</table>
</body>
</html> |