goldy300
New Member
- Messages
- 33
- Reaction score
- 0
- Points
- 0
Well, this time I've gotta create a web application that allows the user to enter in an amount in which is already in AUD and converts it to what ever I have listed in the drop down list when onClick. This one I'd document.write to another page.
I wasn't sure about adding the value of what other currencies are to each var. Do I sort of have it? And I wasn't sure about assigning the "name" in the select list to a variable... is that like (document.form1.selectlist.name.value) ??
or just document.form1.name.value
Each exercise is different to what I've been helped with on the previous exercise.
Here is my mess:
Thanx guys!
I wasn't sure about adding the value of what other currencies are to each var. Do I sort of have it? And I wasn't sure about assigning the "name" in the select list to a variable... is that like (document.form1.selectlist.name.value) ??
or just document.form1.name.value
Each exercise is different to what I've been helped with on the previous exercise.
Here is my mess:
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Currency Converter </TITLE>
<script type="text/javascript">
function calc()
var usd, eur, gbp, nzd;
var currency; // thought I may have to add this var for the select list??
var usd = (document.form1.usd.value);
var eur = (document.form1.eur.value);
var gbp = (document.form1.gbp.value);
var nzd = (document.form1.nzd.value);
var currency = (document.form1.currency.value);
var usd = 1.39329; //not sure if these currencies are correct. xe has inverse and normal.. or what ever??
var eur = 1.88496;
var gbp = 2.41916; // multiply by AUD here??
var nzd = ;
// was going to doc.write here
</script>
</HEAD>
<BODY>
<center>
<font face="arial" size="2">
<form name="form1">
Convert: <input type="text" name="amount" size="10" value="$0.00"> From AUD Australian Dollars into:
<select name="currency">
<option name="usd">USD United States Dollars</option>
<option name="eur">EUR Euro</option>
<option name="gbp">GBP United Kingdom Pounds</option>
<option name="usd">NZD New Zealand Dollars</option>
</select>
<input type="button" name="convert" value="Go!" onClick="calc()">
</form>
</font>
</center>
</BODY>
</HTML>
Thanx guys!