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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.