Hallo,
Könnte mir jemand bei der umschreibung behilflich sein??
Ich möchte gern das in der 2. Drop Down Menü ein "value" automatisch ausgewählt wird von javascript. Wie bekomme ich das hin??
hier der code
<html>
<head>
<title>JavaScript-Test</title>
<script type='text/javascript' language='javascript'>
<!--
function change_asd2(id) {
// potentielle Eintraege festlegen
var asd2=new Array(
new Array('E-Plus [COLOR=red]>>value=23243<<[/COLOR] ', 'D1 [COLOR=red]>>value=43687<<[/COLOR] ', 'D2'),
new Array('ASIC5 [COLOR=red]>>value=67834<<[/COLOR] ', 'intelligente', 'meine', 'Rest'),
new Array('ASIC6', 'etwas größer', 'etwas kleiner als mittel', 'normales Mittel', 'GIGANTISCH'),
new Array('ASIC7'),
);
var i, ne; // ne -> new entry
// alle Eintraege loeschen
for (i=0; i<document.getElementById('asd2').length; i++) {
document.getElementById('asd2').options[i]=null;
}
// neue Eintraege hinzufuegen
for (i=0; i<asd2[id].length; i++) {
ne=new Option(asd2[id][i], i);
document.getElementById('asd2').options[i]=ne;
}
}
//-->
</script>
</head>
<body bgcolor='white'>
<form action='irgendwo.php' method='post' onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
<font face="Verdana">
<!--webbot bot="Validation" s-data-type="Number" s-number-separators="x," i-maximum-length="15" --><input type="text" name="imei" size=20 maxlength="15" style="font-family: Verdana, Arial, sans-serif; font-size: 9px; color: #000000; border: 1px solid #CCCCCC; background: url('http://www.semaf.at/shop/images/input_box.gif')"></font><p>
<select name="asic" id='asd1' onchange='change_asd2(this.selectedIndex);' style="font-family: Verdana, Arial, sans-serif; font-size: 9px; color: #000000; border: 1px solid #CCCCCC; background: url('http://www.semaf.at/shop/images/input_box.gif')">
<option value="2">auswaehlen</option>
<option value="2">Nokia 1100</option>
<option value="2">Nokia 2100</option>
<option value="2">Nokia 2110</option>
<option value="2">Nokia 2146</option>
<option value="2">Nokia 2300</option>
<option value="2">Nokia 2600</option>
<option value="2">Nokia 3100</option>
<option value="2">Nokia 3105</option>
<option value="2">Nokia 3108</option>
<option value="2">Nokia 3200</option>
<option value="7">Nokia 3220</option>
<option value="2">Nokia 3300</option>
<option value="2">Nokia 3510</option>
<option value="2">Nokia 3520</option>
<option value="2">Nokia 3530</option>
<option value="2">Nokia 3560</option>
<option value="2">Nokia 3570</option>
<option value="2">Nokia 3585</option>
<option value="2">Nokia 3586</option>
<option value="2">Nokia 3588</option>
<option value="2">Nokia 3590</option>
<option value="2">Nokia 3595</option>
<option value="5">Nokia 3600</option>
<option value="5">Nokia 3620</option>
<option value="5">Nokia 3650</option>
<option value="5">Nokia 3660</option>
<option value="2">Nokia 5100</option>
<option value="2">Nokia 5140</option>
<option value="2">Nokia 6100</option>
<option value="2">Nokia 6108</option>
<option value="2">Nokia 6170</option>
<option value="2">Nokia 6200</option>
<option value="2">Nokia 6220</option>
<option value="2">Nokia 6225</option>
<option value="6">Nokia 6230</option>
<option value="2">Nokia 6255</option>
<option value="2">Nokia 6260</option>
<option value="2">Nokia 6310</option>
<option value="2">Nokia 6340</option>
<option value="2">Nokia 6360</option>
<option value="2">Nokia 6370</option>
<option value="2">Nokia 6385</option>
<option value="2">Nokia 6390</option>
<option value="2">Nokia 6500</option>
<option value="2">Nokia 6510</option>
<option value="2">Nokia 6560</option>
<option value="2">Nokia 6585</option>
<option value="2">Nokia 6590</option>
<option value="5">Nokia 6600</option>
<option value="2">Nokia 6610</option>
<option value="5">Nokia 6620</option>
<option value="7">Nokia 6650</option>
<option value="5">Nokia 6660</option>
<option value="2">Nokia 6800</option>
<option value="2">Nokia 6810</option>
<option value="2">Nokia 6820</option>
<option value="5">Nokia 7200</option>
<option value="2">Nokia 7210</option>
<option value="2">Nokia 7250</option>
<option value="7">Nokia 7600</option>
<option value="5">Nokia 7650</option>
<option value="5">Nokia 7690</option>
<option value="2">Nokia 7700</option>
<option value="2">Nokia 8310</option>
<option value="2">Nokia 8390</option>
<option value="2">Nokia 8510</option>
<option value="2">Nokia 8910</option>
<option value="5">Nokia 9210</option>
<option value="5">Nokia N-Gage</option>
<option value="5">Nokia N-Gage QD</option>
</select></p>
<p>
<br><br>
<select name='net' id='asd2' onchange='change_asd3(this.selectedIndex);'>
<option>---</option>
</select></p>
<p>
<br><br>
<input type='submit'> </p>
</form>
</body>
</html>
Könnte mir jemand bei der umschreibung behilflich sein??
Ich möchte gern das in der 2. Drop Down Menü ein "value" automatisch ausgewählt wird von javascript. Wie bekomme ich das hin??
hier der code
<html>
<head>
<title>JavaScript-Test</title>
<script type='text/javascript' language='javascript'>
<!--
function change_asd2(id) {
// potentielle Eintraege festlegen
var asd2=new Array(
new Array('E-Plus [COLOR=red]>>value=23243<<[/COLOR] ', 'D1 [COLOR=red]>>value=43687<<[/COLOR] ', 'D2'),
new Array('ASIC5 [COLOR=red]>>value=67834<<[/COLOR] ', 'intelligente', 'meine', 'Rest'),
new Array('ASIC6', 'etwas größer', 'etwas kleiner als mittel', 'normales Mittel', 'GIGANTISCH'),
new Array('ASIC7'),
);
var i, ne; // ne -> new entry
// alle Eintraege loeschen
for (i=0; i<document.getElementById('asd2').length; i++) {
document.getElementById('asd2').options[i]=null;
}
// neue Eintraege hinzufuegen
for (i=0; i<asd2[id].length; i++) {
ne=new Option(asd2[id][i], i);
document.getElementById('asd2').options[i]=ne;
}
}
//-->
</script>
</head>
<body bgcolor='white'>
<form action='irgendwo.php' method='post' onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
<font face="Verdana">
<!--webbot bot="Validation" s-data-type="Number" s-number-separators="x," i-maximum-length="15" --><input type="text" name="imei" size=20 maxlength="15" style="font-family: Verdana, Arial, sans-serif; font-size: 9px; color: #000000; border: 1px solid #CCCCCC; background: url('http://www.semaf.at/shop/images/input_box.gif')"></font><p>
<select name="asic" id='asd1' onchange='change_asd2(this.selectedIndex);' style="font-family: Verdana, Arial, sans-serif; font-size: 9px; color: #000000; border: 1px solid #CCCCCC; background: url('http://www.semaf.at/shop/images/input_box.gif')">
<option value="2">auswaehlen</option>
<option value="2">Nokia 1100</option>
<option value="2">Nokia 2100</option>
<option value="2">Nokia 2110</option>
<option value="2">Nokia 2146</option>
<option value="2">Nokia 2300</option>
<option value="2">Nokia 2600</option>
<option value="2">Nokia 3100</option>
<option value="2">Nokia 3105</option>
<option value="2">Nokia 3108</option>
<option value="2">Nokia 3200</option>
<option value="7">Nokia 3220</option>
<option value="2">Nokia 3300</option>
<option value="2">Nokia 3510</option>
<option value="2">Nokia 3520</option>
<option value="2">Nokia 3530</option>
<option value="2">Nokia 3560</option>
<option value="2">Nokia 3570</option>
<option value="2">Nokia 3585</option>
<option value="2">Nokia 3586</option>
<option value="2">Nokia 3588</option>
<option value="2">Nokia 3590</option>
<option value="2">Nokia 3595</option>
<option value="5">Nokia 3600</option>
<option value="5">Nokia 3620</option>
<option value="5">Nokia 3650</option>
<option value="5">Nokia 3660</option>
<option value="2">Nokia 5100</option>
<option value="2">Nokia 5140</option>
<option value="2">Nokia 6100</option>
<option value="2">Nokia 6108</option>
<option value="2">Nokia 6170</option>
<option value="2">Nokia 6200</option>
<option value="2">Nokia 6220</option>
<option value="2">Nokia 6225</option>
<option value="6">Nokia 6230</option>
<option value="2">Nokia 6255</option>
<option value="2">Nokia 6260</option>
<option value="2">Nokia 6310</option>
<option value="2">Nokia 6340</option>
<option value="2">Nokia 6360</option>
<option value="2">Nokia 6370</option>
<option value="2">Nokia 6385</option>
<option value="2">Nokia 6390</option>
<option value="2">Nokia 6500</option>
<option value="2">Nokia 6510</option>
<option value="2">Nokia 6560</option>
<option value="2">Nokia 6585</option>
<option value="2">Nokia 6590</option>
<option value="5">Nokia 6600</option>
<option value="2">Nokia 6610</option>
<option value="5">Nokia 6620</option>
<option value="7">Nokia 6650</option>
<option value="5">Nokia 6660</option>
<option value="2">Nokia 6800</option>
<option value="2">Nokia 6810</option>
<option value="2">Nokia 6820</option>
<option value="5">Nokia 7200</option>
<option value="2">Nokia 7210</option>
<option value="2">Nokia 7250</option>
<option value="7">Nokia 7600</option>
<option value="5">Nokia 7650</option>
<option value="5">Nokia 7690</option>
<option value="2">Nokia 7700</option>
<option value="2">Nokia 8310</option>
<option value="2">Nokia 8390</option>
<option value="2">Nokia 8510</option>
<option value="2">Nokia 8910</option>
<option value="5">Nokia 9210</option>
<option value="5">Nokia N-Gage</option>
<option value="5">Nokia N-Gage QD</option>
</select></p>
<p>
<br><br>
<select name='net' id='asd2' onchange='change_asd3(this.selectedIndex);'>
<option>---</option>
</select></p>
<p>
<br><br>
<input type='submit'> </p>
</form>
</body>
</html>
Kommentar