Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

1. ## Currency Calculator PROBLEM

Hey I've been working on my Spanish Clubs' website over the summer and I need some help when making this converter. I want to make it so when someone chooses a different country, it will change the answeres and do the equation in the text boxes and also if they change the numbers manually they will also do the equation.

Here is the javascript code I made:

Code:
```function calculatecountry()
{
var country = calculate.countrys.options[calculate.countrys.selectedIndex].text;

//===============================COUNTRIES====================================
if (countrys=="--Country--")
{
var usd1 = 0;
var other1 = 0;
}
if (countrys=="Argentina")
{
var usd1 = 0.2553;
var other1 = 1;
}
if (countrys=="Bolivia")
{
var usd1 = 0.14245;
var other1 = 1;
}
if (countrys=="Chile")
{
var usd1 = 0.0018;
var other1 = 1;
}
//================================EQUATIONS=====================================

var c1 = calculate.other.value;
var c2 = calculate.usd.value;

var ans1 = c1 * other1;
var ans2 = c2 * usd1;

calculate.usd.value = ans1;
calculate.other.value = ans2;
}```
Here is the form code:

Code:
```

<script type="text/javascript" src="js_money_calc.js"></script>

Converter
<form name="calculate">
<select name="countrys" onChange="calculatecountry()">
<option selected>--Country--</option>
<option>Argentina</option>
<option>Bolivia</option>
<option>Chile</option>
</select><p>
<input type="text" name="usd" onKeyUp="calculatecountry()" /> = <input type="text" name="other" onKeyUp="calculatecountry()" /></p>
</form>

</body></html>```
Thanks.

• If anyone knows a solution, I'd greatly appreciate it.

• anything at all will help I'd like some feedback, I've been waiting for like 24 hours.

•