Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function convert() { var Amount = document.getElementById('amount'); var Currency = document.getElementById('currency'); var Converted = document.getElementById('converted'); var Choice = document.getElementById('choice'); var AED = 1; var US = 0.27; var QR = 0.99; var SR = 1.02; var KD = 0.0778; var BD = 0.102; switch (document.converter.currency.value) { case "US Dollars": var x = US * document.converter.amount.value; document.converter.converted.value = x.toFixed(2); document.converter.choice.value = document.converter.currency.value; break; case "Qatar Riyal": var x = QR * document.converter.amount.value; document.converter.converted.value = x.toFixed(2); document.converter.choice.value = document.converter.currency.value; break; case "Saudi Riyal": var x = SR * document.converter.amount.value; document.converter.converted.value = x.toFixed(2); document.converter.choice.value = document.converter.currency.value; break; case "Kuwaiti Dinar": var x = KD * document.converter.amount.value; document.converter.converted.value = x.toFixed(2); document.converter.choice.value = document.converter.currency.value; break; case "Bahrain Dinar": var x = BD * document.converter.amount.value; document.converter.converted.value = x.toFixed(2); document.converter.choice.value = document.converter.currency.value; break; } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="divWrapper"&gt; &lt;form name="converter" id="converter"&gt; Enter amount in UAE Dirhams AED &lt;input name="amount" type="text" id="amount" size="7" /&gt; &lt;br /&gt; &lt;br /&gt; Please select a currency &lt;select name="currency" id="currency"&gt; &lt;option&gt;Please Choose One&lt;/option&gt; &lt;option value="US Dollars"&gt;US Dollars&lt;/option&gt; &lt;option value="Qatar Riyal"&gt;Qatar Riyal&lt;/option&gt; &lt;option value="Saudi Riyal"&gt;Saudi Riyal&lt;/option&gt; &lt;option value="Kuwaiti Dinar"&gt;Kuwaiti Dinar&lt;/option&gt; &lt;option value="Bahrain Dinar"&gt;Bahrain Dinar&lt;/option&gt; &lt;/select&gt;&lt;br /&gt; &lt;br /&gt; The amount is: &lt;input name="converted" type="text" id="converted" value="" size="7" /&gt; in &lt;input name="choice" type="text" id="choice" style="border: 0px" value="" /&gt; &lt;br /&gt; &lt;br /&gt; &lt;input type="button" name="convt" id="convt" onclick="convert()" value="Convert" /&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload