Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Add currency to as value

Add currency to as value

Add currency to as value

I need help with the following.
On MY JAVASCRIPT CODE I need num4 to use the currency automatically for ZAR using USD (1$=14.01 ZAR) using the CURRENCY SCRIPT, but not sure how to do it



<font color="red"><b><label for="usd">leave blank</label></b></font>
<font color="PURPLE"><b><label for="zar"></label></b></font>
<input style="color: #17202A; font-family: Comic Sans MS; font-weight: bold; font-size: 12px; background-color: #AED6F1; type="usdzar" id="zar" name="zar">
<button type="button" onclick="multiply1()">Multiply</button>
<input style="color: #17202A; font-family: Comic Sans MS; font-weight: bold; font-size: 12px; background-color: #E8F8F5; type="text" id="result1" name="result1"> 


CODE --> Java

        function multiply1(){
            var num3 = document.getElementById("result").value.replace(/,/g,''); //remove any commas
			var num4 = document.getElementById("zar").value;
            var result1 = num3 * num4;
            document.getElementById("result1").value = result1.toLocaleString('en-US',{ maximumFractionDigits: 8 });
			document.getElementById("result1").style.color = "red";
			document.getElementById("result1").style.fontWeight = "900";

Currency Script

CODE --> java

<script>function reloadFnAj0a2vV(){ var sc = document.getElementById('scFnAj0a2vV');if (sc) sc.parentNode.removeChild(sc);sc = document.createElement('script');sc.type = 'text/javascript';sc.charset = 'UTF-8';sc.async = true;sc.id='scFnAj0a2vV';sc.src = 'https://freecurrencyrates.com/en/widget-horizontal?iso=USD-ZAR&df=1&p=FnAj0a2vV&v=fits&source=fcr&width=500&width_title=225&firstrowvalue=1&thm=8E846B,FEEEBD,494437,817865,FFFFFF,D19405,FECE2F,383838,000000&title=Currency%20Converter&tzo=-120';var div = document.getElementById('gcw_mainFnAj0a2vV');div.parentNode.insertBefore(sc, div);} reloadFnAj0a2vV(); </script> 

How will you spend eternity - Smoking or Non Smoking?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close