ASP-FastBoard - Demo/Support-Forum
Forum anmelden / register Board



SearchSearch CalendarCalendar GalleryGalleryAuction-PortalAuctions GlobalGlobal Top-ListTopMembersMembers StatisticsStats
get your RSS-Feed
Language/Sprache:  Admin  
 Login: ChatChat (0) new User-MapUser-Mapsend Passwordsend Password RegisterRegister

Forum Overview » Programmieren » HTML/JavaScript/CSS » Multible SELECT-List
Pages: (1) [1] »
Registration necessaryRegistration necessary
Multible SELECT-List
Cyberlordno Access no Access first Post cannot be deleted -> delete the whole Topic 
Group: Administrator
Level: heavy Spammer


Posts: 4135
Joined: 3/11/2004
IP-Address: saved
offline


Du kannst mehrere SELECT-Menüs erstellen und einzelne Teile hin und her verschieben.

Das sieht dann ungefähr so aus:



Beispiel:
http://www.cyberlord.at/tutorials/multiselect.html

Der komplette Quellcode:


<html><head>
<title>Multible SELECT-List</title>
</head>
<body>

<script language= "JavaScript">
function einszuzwei() {
m1len = m1.length ;
for ( i=0; i<m1len ; i++){
if (m1.options.selected == true ) {
m2len = m2.length;
m2.options[m2len]= new Option(m1.options.text);
}
}

for ( i = (m1len -1); i>=0; i--){
if (m1.options.selected == true ) {
m1.options = null;
}
}
}

function zweizueins() {
m2len = m2.length ;
for ( i=0; i<m2len ; i++){
if (m2.options.selected == true ) {
m1len = m1.length;
m1.options[m1len]= new Option(m2.options.text);
}
}
for ( i=(m2len-1); i>=0; i--) {
if (m2.options.selected == true ) {
m2.options = null;
}
}
}
</script>

<form method="POST" name="testform">
<table align=center >
<tr><td align=center>
<select name=select1 size=10 multiple>
<option>Auswahl 1</option>
<option>Auswahl 2</option>
<option>Auswahl 3</option>
<option>Auswahl 4</option>
<option>Auswahl 5</option>
</select><br>
<p align=center><input type="button" onClick="einszuzwei()" value="auswählen"></p>

</td><td align=center>

<select name=select2 size=10 multiple >
<option>Auswahl 6</option>
</select><br>
<p align=center><input type="button" onClick="zweizueins()" value="abwählen" ></p>
</td></tr></table>
<p align=center>Mit STRG meherere Felder auswählen.</p>
</form>

<script language="JavaScript">
var m1 = document.testform.select1;
var m2 = document.testform.select2;
</script>

</body></html>



edited by Cyberlord on 5/12/2004 10:15:00 PM
Forum-Changelog || zu unseren Angeboten
5/12/2004 9:54:00 PM    
Registration necessaryRegistration necessary
Pages: (1) [1] »
all Times are GMT +1:00
Thread-Info
AccessModerators
Reading: all
Writing: User
Group: general
none
Forum Overview » Programmieren » HTML/JavaScript/CSS » Multible SELECT-List

.: Script-Time: 0.063 || SQL-Queries: 6 || Active-Users: 375 :.
Powered by ASP-FastBoard HE v0.8, hosted by cyberlord.at