Hi
Ich wollte dich noch etwas fragen wegen meinem Taschenrechner.
Hoffe ich mach nicht zuviel Arbeit weiss mir aber nicht mehr zu helfen und kein anderer außer du hat auf meinen Forumbeitrag geantwortet. Ich habe es jetzt soweit hinbekommen das er mir den ausgewählten kurs in wechselkurs anzeigt wird und nun stellt sich mir folgende frage.....
Frage:
Gibt es jetzt irgendeine möglichkeit der variablen b einen anderen Wert zuzuweisen (Im Feld Wechselkurse rot makiert) und das er dann damit weiterrechnet?
Wenn ja kannst du mir sagen wie ich es machen muß und es wäre nett wenn du es mir auch erklären könntest falls es möglich ist damit ich vielleicht irgenwan mal das programmieren verstehe und nicht ständig Leuts nerven muß :).
Quelltext:
<html>
<head>
<script language="JavaScript">
<!--
function umrechnen()
{
fehlersuche ()
var a=document.form.geldwert.value;
var b;
if (document.form.devisen.selectedIndex==0){b=1.1215;}
if (document.form.devisen.selectedIndex==1){b=0.6998;}
if (document.form.devisen.selectedIndex==2){b=1.5135;}
if (document.form.devisen.selectedIndex==3){b=133.3333;}
if (document.form.devisen.selectedIndex==4){b=34.9650;}
if (document.form.devisen.selectedIndex==5){b=53.1915;}
if (document.form.devisen.selectedIndex==6){b=4.2626;}
if (document.form.devisen.selectedIndex==7){b=31.2500;}
if (document.form.devisen.selectedIndex==8){b=7.4294;}
if (document.form.devisen.selectedIndex==9){b=1.5911;}
if (document.form.devisen.selectedIndex==10){b=1.9912;}
if (document.form.devisen.selectedIndex==11){b=39.0625;}
if (document.form.devisen.selectedIndex==12){b=1.7778;}
if (document.form.devisen.selectedIndex==13){b=6.6845;}
if (document.form.devisen.selectedIndex==14){b=10000.0000;}
if (document.form.devisen.selectedIndex==15){b=58.8235;}
if (document.form.devisen.selectedIndex==16){b=1.4550;}
if (document.form.devisen.selectedIndex==17){b=40.8163;}
if (document.form.devisen.selectedIndex==18){b=9.2851;}
if (document.form.devisen.selectedIndex==19){b=27.2480;}
if (document.form.devisen.selectedIndex==20){b=2.2321;}
if (document.form.devisen.selectedIndex==21){b=2.2095;}
if (document.form.devisen.selectedIndex==22){b=1.1161;}
if (document.form.devisen.selectedIndex==23){b=1.9806;}
if (document.form.devisen.selectedIndex==24){b=0.9196;}
if (document.form.devisen.selectedIndex==25){b=2.1782;}
if (document.form.devisen.selectedIndex==26){b=200.0000;}
if (document.form.devisen.selectedIndex==27){b=8.7489;}
if (document.form.devisen.selectedIndex==28){b=8.3682;}
if (document.form.devisen.selectedIndex==29){b=63.6943;}
if (document.form.devisen.selectedIndex==30){b=1.9794;}
if (document.form.devisen.selectedIndex==31){b=6.9061;}
if (document.form.devisen.selectedIndex==32){b=909.0909;}
if (document.form.devisen.selectedIndex==33){b=2.9949;}
if (document.form.devisen.selectedIndex==34){b=47.8469;}
document.form.wechselkurs.value=b;
var c = a/b;
document.form.eurowert.value="";
var d=Math.round(c*100)/100
if(document.form.runden[0].checked==true){document.form.eurowert.value=d;
}
else
{
document.form.eurowert.value=c;
}
}
function fehlersuche ()
{
if (document.form.geldwert.value=="")
alert ("Bitte geben sie einen Betrag ein");
document.form.geldwert.focus ();
document.form.geldwert.select ();
}
// -->
</script>
</head>
<body>
<table border=0 bordercolorlight="#000000" bordercolor="#000000" cellspacing="0" bordercolordark="#000000" width="329">
<tr>
<td bordercolor="#303030" bordercolorlight="#202020" bordercolordark="#303030" bgcolor="#808080" width="317">
<b><font size="5" color="#202020"></font><font size="5">Eurotaschenrechner</font></b></td>
</tr>
<form name="form">
<table border=0 bordercolorlight="#909090" bordercolor="#000000" cellspacing="1" bordercolordark="#000000" width="329">
<tr>
<td bgcolor="#CCCCCC" width="317>
<font face="Arial" color="black"><font class="stn">Betrag: </font>
<span style="background-color: #FFFF00">
<input type="text" name="geldwert" size="10"></span><br>
</tr>
</td>
<tr>
<td bgcolor="#CCCCCC" width="317>
<font class="stn">Ergebnis:</font>
<input type="radio" name="runden" value="runden" checked>gerundet
<input type="radio" name="runden" value="exakt">genau <br>
</tr>
</td>
<tr>
<td bgcolor="#CCCCCC" width="317>
<font class="stn">Währung:</font>
<select name="devisen" size="1">
<option selected>US-Dollar </option>
<option>Englische Pfund</option>
<option>Schweizer Franken</option>
<option>Japanischer Yen </option>
<option>Russischer Rubel</option>
<option>Indische Rupie</option>
<option>Polnischer Zloty</option>
<option>Techechenische Krone</option>
<option>Dänishce Krone</option>
<option>Kanadischer Dollar</option>
<option>Taiwanischer Dollar</option>
<option>Australischer Dollar</option>
<option>Ägyptisches Pfund</option>
<option>Indonesische Rupiah</option>
<option>Phillipinscher Peso</option>
<option>Tunesischer Dinar</option>
<option>Slowakische Krone</option>
<option>Chinesischer Renmimbi</option>
<option>Dominikanischer Peso</option>
<option>Barbados-Dollar</option>
<option>Belize-Dollar</option>
<option>Bermuda-Dollar</option>
<option>Brunei-Dollar</option>
<option>Kaiman-Dollar</option>
<option>Fidschi-Dollar</option>
<option>Guyana-Dollar</option>
<option>Hong-Kong Dollar</option>
<option>Salomonen-Dollar</option>
<option>Jamaikanischer Dollar</option>
<option>Singapur Dollar</option>
<option>Trinidad/Tobago Dollar</option>
<option>Simbabwe-Dollar</option>
<option>Ost-Karibischer Dollar</option>
<option>Thailändischer Bath</option>
</select> <br>
</tr>
</td>
<tr>
<td bgcolor=red width="317>
<font class="stb">Wechselkurs:</font>
<input type="text" name="wechselkurs" size="15"><br>
</tr>
</td>
<tr>
<td bgcolor="#CCCCCC" width="317>
<font class="stb">Berechneter Euro-Betrag:</font>
<input type="text" name="eurowert" size="15"> <br>
</tr>
</td>
<tr>
<td bgcolor="#CCCCCC" width="#202020">
<input type="button" value="Umrechnen" name="Umrechnen" onclick="umrechnen()">
<input type="reset" value="Zurücksetzen" name="reset">
</tr>
</td>
</form>
</td>
</tr>
</table>
</table>
</font>
</body>
</html>
Hoffe du kannst mir helfen ich bedanke mich schon mal im voraus.
mfg Max