Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html >
- <html >
- <head>
- <title>Currency Converter</title>
- <script>
- function converter(){
- var euro = parseInt(document.getElementById('euro').value);
- var com = parseInt(document.getElementById('com').value);
- var kom = parseInt(document.getElementById('kom').value);
- var convert = document.getElementById('convert').value;
- var cv = document.getElementById('cv12');
- var cv3 = document.getElementById('cv34')
- if(convert == 1){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 1.9558) ;
- cv.type = "text";
- cv3.value = (euro * 1.9558) - cv.value;
- cv3.type = "text";
- }
- if(convert == 2){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 1.0690);
- cv.type = "text";
- cv3.value = (euro * 1.0690) - cv.value;
- cv3.type = "text";
- }
- if(convert == 3){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 25.615);
- cv.type = "text";
- cv3.value = (euro * 25.615) - cv.value;
- cv3.type = "text";
- }
- if(convert == 4){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 7.4406);
- cv.type = "text";
- cv3.value = (euro * 7.4406) - cv.value;
- cv3.type = "text";
- }
- if(convert == 5){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 0.84290);
- cv.type = "text";
- cv3.value = (euro * 0.84290) - cv.value;
- cv3.type = "text";
- }
- if(convert == 6){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 7.5132);
- cv.type = "text";
- cv3.value = (euro * 7.5132) - cv.value;
- cv3.type = "text";
- }
- if(convert == 7){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 363.39);
- cv.type = "text";
- cv3.value = (euro * 363.39) - cv.value;
- cv3.type = "text";
- }
- if(convert == 8){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 9.7065);
- cv.type = "text";
- cv3.value = (euro * 9.7065) - cv.value;
- cv3.type = "text";
- }
- if(convert == 9){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 4.6030);
- cv.type = "text";
- cv3.value = (euro * 4.6030) - cv.value;
- cv3.type = "text";
- }
- if(convert == 10){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 4.9467);
- cv.type = "text";
- cv3.value = (euro * 4.9467) - cv.value;
- cv3.type = "text";
- }
- if(convert == 11){
- cv.value = ((100 - (com + kom)) / 100 ) * (euro * 10.0145);
- cv.type = "text";
- cv3.value = (euro * 10.0145) - cv.value;
- cv3.type = "text";
- }
- }
- </script>
- <head>
- <body>
- <form action="#" method="post" name="cc">
- Darijuma summa: <input id="euro" type="text" name="euro" >EUR<br>
- Darijuma valuta: <select name="convert" id ="convert" >
- <option value="0">Select the Currency</option>
- <option value="1">BGN</option>
- <option value="2">CHF</option>
- <option value="3">CZK</option>
- <option value="4">DKK</option>
- <option value="5">GBP</option>
- <option value="6">HRK</option>
- <option value="7">HUF</option>
- <option value="8">NOK</option>
- <option value="9">PLN</option>
- <option value="10">RON</option>
- <option value="11">SEK</option>
- </select><br>
- Bankas komisija: <input id="com" type="text" name="comm" value="2">%<br>
- EU komisija: <input id="kom" type="text" name="kom">%<br>
- <input type="button" name="submit" value="Convert" onclick="converter()">
- </form><br>
- Komisija: <input type="hidden" name="cv3" id="cv34" readonly><br>
- Gala summa: <input type="hidden" name="cv" id="cv12" readonly />
- </body>
- <html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement