Wie unten gezeigt:
Kopieren Sie den Code -Code wie folgt:
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<kopf>
<meta http-äquiv = "content-type" content = "text /html; charset = utf-8" /> />
<title> Nicht -Title -Dokument </title>
<script type = "text/javaScript">
Funktion CopyTolist (von, bis) {
var fromList = eval ('document.forms [0].'+von);
var tolist = eval ('document.forms [0].'+to);
if (tolist.options.length> 0 && tolist.options [0]. value == 'temp') {
Tolist.options.length = 0;
}
var sel = false;
für (i = 0; i <teomlist.options.length; i ++) {
var current = from list.options [i];
if (current.select) {
Sel = true;
If (current.Value == 'temp') {{{{{{{{{{{{{{{{
Alarm ('kann dieses Projekt nicht wählen!');
Zurückkehren;
}
txt = current.text;
value = current.Value;
tolist.options [tolist.length] = new option (txt, value);
Von list.options [i] = null;
ich ---;
}
}
if (! sel) alarm ('Sie haben noch kein Projekt ausgewählt!');
}
Funktion AllSelect () {
var chsen = document.getElementById ('ausgewählt');
// Wenn das CHSEN -Listenfeld 0 ist oder der erste Optionswert 'temp' ist
if (chsen.length && chsen.opting [0]. value == "temp")
Zurückkehren;
für (var i = 0; i <chsen.length; i ++) {
chsen.options [i] .Select = true;
}
// Daten abrufen
Funktion getData () {
var list = document.forms [0] .rolelist;
// Erhalten Sie ein verstecktes Textfeldobjekt
var rollen = document.getElementById ("trolelist");
Rollen.Value = "";
var s = "";
if (list.length! = 0) {{{{{{{{{{{{{{{{{
für (i = 0; i <list.length; i ++) {
s + = list.option [i].
}
}
Rollen.Value = S;
}
}
</script>
</head>
<body>
<tabelle>
<Formular OnSubmit = "AllSelect ()">
<tr>
<td>
<select name = "postible" size = "4" multiple>
<Option Value = "1"> Guangzhou, China </Option>
<Option Value = "2"> Shanghai, China </Option>
<Option Value = "3"> Peking, China </Option>
<Option Value = "4"> China Wuhan </Option>
</select>
</td>
<td> <a href = "JavaScript: CopyTolist ('Möglich', 'ausgewählt')"> zum rechten-> <br> hinzufügen
<br>
</a> <a href = "JavaScript: CopyTolist ('ausgewählt', 'postible')"> <-add links </a> </td>
<td>
<select name = "ausgewählt" size = "4" multiple>
<Option Value = "Test"> Wählen Sie Ihren Bereich von links </option> aus
</select>
</td>
</tr>
</form>
</table>
<input type = "button" value = "suruging" onclick = "Allselect ()" /> yle
<Eingabe type = "text" style = "display: keine;" id = "Truelist">
</body>
</html>