Java Script- What is wrong [message #229446] |
Mon, 06 November 2006 19:15 |
|
Nodbugger
Messages: 976 Registered: February 2003
Karma: 0
|
Colonel |
|
|
<html>
<head><title>Conversion</title></head>
<body bgcolor="33cccc"><font face="Helvetica"><center>
<h1>How Much Is It?</h1>
<script language="Javascript">
function convertD2E (priceInD) {return .70*priceInE;}
function convertE2D (priceInE) {return 1.27*(priceInD);
}
</script>
<form name="amount">
<h2> US Dollars:
<input type=text name="textPriceD" size=4
onChange="document.amount.textPriceE.value = convertD2E(document.amount.textPriceD.value)"> $</h2>
<h2> EU Euros:
<input type=text name="textPriceE" size=4
onChange="document.amount.textPriceD.value = convertE2D(document.amount.textPriceE.value)"> €</h2>
</form></center>
</body>
</html>
|
|
|
Re: Java Script- What is wrong [message #229453 is a reply to message #229446] |
Mon, 06 November 2006 21:10 |
|
Nodbugger
Messages: 976 Registered: February 2003
Karma: 0
|
Colonel |
|
|
Never mind, I got it.
<html>
<head>
<title>Conversion - Dollars and Euros</title></head>
<body bgcolor="FFFFF"><font face="Times New Roman"><center>
<h1><i>Currency Converter</i></h1>
<table border=1 cellpadding=0 cellspacing=0 width=20%>
<TR><TD bgcolor="maroon" align=center>
<table broder=0 cellpadding=0 cellspacing=2>
<tr><td></td></tr></table>
</td></tr></table>
<script language="Javascript">
function convertD2E (priceInD) {return .79*priceInD;}
function convertE2D (priceInE) {return 1.27*priceInE;
}
</script>
<form name="amount">
<h2> <i>US $:</i>
<input type=text name="textPriceD" size=4
<INPUT type="button" value="Convert to €" name="button1" onClick="document.amount.textPriceE.value = convertD2E(document.amount.textPriceD.value)">
<h2> <i>EU €:</i>
<input type=text name="textPriceE" size=4
<INPUT type="button" value="Convert to $" name="button2" onClick="document.amount.textPriceD.value = convertE2D(document.amount.textPriceE.value)">
<br>
<br>
<table border=1 cellpadding=0 cellspacing=0 width=20%>
<TR><TD bgcolor="maroon" align=center>
<table broder=0 cellpadding=0 cellspacing=2>
<tr><td></td></tr></table>
</td></tr></table>
<input type="reset" value="Reset">
</form></center>
</body>
</html>
|
|
|