Linking a textbox value to coinmill script for currency conversion -
i got currency exchange script coinmill. want modify work nice in page. newbie in html/javascript programming thats why asking on one, pls.
<script src="http://coinmill.com/frame.js"></script> <script> var currency_round=true; var currency_decimalseparator='.'; var currency_thousandsseparator=','; var currency_thousandsseparatormin=3; </script> $199.00 (us) = <script>currency_show_conversion(199.00,"usd","gbp");</script> gbp<br> <small>currency data courtesy <a href="http://coinmill.com/">coinmill.com</a></small>
this scripts works fine shows conversion default value in script. need replace value ($199.00) value textbox of id "edit_1". automatically after user inserts currency exchange, value show in page.
thanks in advance.
i stephen ostermiller, , run http://coinmill.com/. can make work javascript currency api coinmill:
- put on
onchange
event on textarea - get value text area using
this.value
- use
currency_convert(value,from,to)
method available inframe.js
convert currency of choice - write value want in page, example
document.getelementbyid('results').innerhtml
putting together:
<script src="http://coinmill.com/frame.js"></script> <script> var currency_round=true; var currency_decimalseparator='.'; var currency_thousandsseparator=','; var currency_thousandsseparatormin=3; </script> <textarea id=edit_1 onchange="document.getelementbyid('results').innerhtml=currency_convert(this.value,'usd','gbp')"></textarea><br> converted gbp:<div id=results></div> <p><small>currency data courtesy <a href="http://coinmill.com/">coinmill.com</a></small></p>
whene enter "273" textarea, see "converted gbp: 176.32" on page.
you can test out live example on jsfiddle: http://jsfiddle.net/waxnq/
Comments
Post a Comment