Comme indiqué ci-dessous:
Copier le code du code comme suit:
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<adal>
<meta http-equiv = "content-type" content = "text / html; charset = utf-8" /> />
<Title> Document non-title </TITME>
<script type = "text / javascript">
Function copyTolist (de, à) {
var fromlist = evaled ('document.forms [0].' + from);
var tolist = eval ('document.forms [0].' + à);
if (tolist.options.length> 0 && tolist.options [0]. Value == 'Temp') {
Tolist.options.length = 0;
}
var sel = false;
pour (i = 0; i <teomlist.options.length; i ++) {
var current = fromlist.options [i];
if (current.select) {
Sel = true;
If (current.value == 'temp') {{{
Alert ('Can't Choison Choisir ce projet!');
Retour;
}
txt = current.Text;
valeur = current.Value;
tolist.options [tolist.length] = nouvelle option (txt, valeur);
FromList.options [i] = null;
je ---;
}
}
if (! sel) alert («vous n'avez pas encore choisi de projet!»);
}
fonction allSelect () {
var chsen = document.getElementById ('choisi');
// Si la zone de liste CHSEN est 0 ou la première valeur d'option est «Temp»
if (chsen.length && chsen.opting [0]. valeur == "temp")
Retour;
pour (var i = 0; i <chsen.length; i ++) {
chsen.options [i] .Select = true;
}
// Obtenez des données
Fonction getData () {
var list = document.forms [0] .roleList;
// Obtenez un objet de zone de texte cachée
var rôles = document.getElementById ("trolelist");
rôles.value = "";
var s = "";
if (list.length! = 0) {{{
pour (i = 0; i <list.length; i ++) {
s + = list.option [i].
}
}
Rôles.value = s;
}
}
</cript>
</ head>
<body>
<ballage>
<Formulaire onsubmit = "alselect ()">
<tr>
<TD>
<select name = "postible" size = "4" multiple>
<Option Value = "1"> Guangzhou, Chine </ Option>
<Option Value = "2"> Shanghai, Chine </ Option>
<Option Value = "3"> Pékin, Chine </opoption>
<Option Value = "4"> Chine Wuhan </ Option>
</lect>
</td>
<td> <a href = "javascript: copyTolist ('possible', 'choisi')"> ajouter à droite-> <br>
<br>
</a> <a href = "javascript: copytolist ('choisi', 'postible')"> <-add à gauche </a> </td>
<TD>
<select name = "choisi" size = "4" multiple>
<Option Value = "Test"> Sélectionnez votre zone à gauche </ Option>
</lect>
</td>
</tr>
</ form>
</ table>
<entrée type = "bouton" value = "soumettre" onclick = "alselect ()" /> yle
<entrée type = "text" style = "affichage: aucun;"
</docy>
</html>