<script type=”text/javascript”>
function guncelle( ) {
var birimfiyat = document.form1.halitipi.options[document.form1.halitipi.selectedIndex].value;
var miktar = document.form1.miktar.value;
document.getElementById(‘sonuc’).innerHTML=parseInt(miktar) * birimfiyat;
}
</script>
<form name=”form1″>
<select name=”halitipi” onchange=”guncelle( )”>
<option value=”10″>Halı 1</option>
<option value=”20″>Halı 2</option>
<option value=”30″>Halı 3</option>
<option value=”40″>Halı 4</option>
</select>
<input name=”miktar” type=”text” onchange=”guncelle( )”>
<br />
Fiyat: <label id=”sonuc”></label>
</form>