<html> <head><title> Form </title></head> <body> <form> <h1>Currency Converter</h1> USD to: <select name="currency"> <option value="eur">Euro</option> <option value="thb">Thai Bhat</option> <option value="php">Philippine Peso</option> <option value="hkd">Hong Kong Dollar</option> <option value="sar">Saudi Arabia Riyal</option> </select> <br /> Input USD: <input type=textbox name="input" size=13> <br /> Converted Value: <input type=textbox name="value" size=7> <br /> <input type=button name="convert" value="Convert"> </select> </form> </body> </html>
and after reading some things that is related to this. i came-up with this things.
<html>
<head><title>
Form
</title>
<script type="text/javascript">
function convert()
{
var usd,eur,php,thb,hkd,sar;
usd = parseInt(document.form1.inp.value);
eur = (usd*0.73);
document.form1.eur.value = eur;
php = (usd*46.60);
document.form1.php.value = php;
thb = (usd*33.25);
document.form1.thb.value = thb;
hkd = (usd*7.8);
document.form1.hkd.value = hkd;
sar = (usd*4.00);
document.form1.sar.value = sar;
}
</script>
</head>
<body>
<form method="post" name="form1" onsubmit="convert();return false;">
<h1>Currency Converter</h1>
<input type="textbox" name="inp" size="13" value="1" /> USD
<br />
is
<br />
<input type="textbox" name="eur" size="13" value="0.73" /> Euro
<br />
<input type="textbox" name="php" size="13" value="46.6" /> Philippine Peso
<br />
<input type="textbox" name="thb" size="13" value="33.25" /> Thai Bhat
<br />
<input type="textbox" name="hkd" size="13" value="7.8" /> Hong Kong Dollar
<br />
<input type="textbox" name="sar" size="13" value="4" /> Saudi Arabia Riyal
<br />
<input type="button" value="Convert" onclick="convert()" />
</select>
</form>
</body>
</html>
now. is there anyone could help me? thanks in advance. and btw. sorry for posting another thread. my first thread's title is not right.please delete it. thnx.
This post has been edited by useletters: 07 February 2010 - 05:36 AM

New Topic/Question
Reply



MultiQuote





|