Jump to content

[SOLVED] Currency conversion help?


ibda12u

Recommended Posts

Hello, I'm getting a javascript error when I run the following code on my page. I am at a total lost, can anyone point me in the right direction, so I can figure what is causing the error?

 

Pretty much this is supposed to be a simple currency convertor.

 

Thanks,

Ibda

 

<head>
<title>Money Exchange</title>
<script language="JavaScript">
<!--
function convert() {
   var amt = parseFloat(exchange.amount.value);
   var euro = Math.round((amt * .0.636821) * 100) / 100;
   document.write(exchange.amount.value + " dollars is " + euro + " Euros");
}
//-->
</script>
</head>
<body>

<form name="exchange" action="javascript:convert()" method="post">
Amount to convert
<input type="text" name="amount"><br/><br>
<input type="radio" name="RBgender" value="euro" id="radio1">Euro to Dollar<br>
<input type="radio" name="RBgender" value="dollar" id="radio2">Dollar to Euro<br><br>
<input type="submit" value="Submit Form">
</form>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/107873-solved-currency-conversion-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.