Ну вот пример:
<script type="text/javascript">
function go(){
var num = document.getElementById('num').value,
int = document.getElementById('comp').value,
result = document.getElementById('result');
result.innerHTML = int * (num > 21 ? 600 : 1200)
}
</script>
<form>
<label>
Число <input type="text" value="1" name="comp" id="comp">
Кол-во <input type="text" value="1" id="num">
<input type="button" value="*" onclick="go();"/>
<br>
</label>
</form>
<div id="result"></div>