Или так:
<form name="form1">
<input type="text" onclick="this.style.backgroundColor = 'white';" name="visota" /><br/>
<input type="text" onclick="this.style.backgroundColor = 'white';" name="shirina" /><br/>
<input type="button" onclick="raschet(this.form)" value="Перемножить" /><br/>
<input type="text" name="res_metall" />
</form>
<script>
function check(el){
if(isNaN(el.value)) {
el.style.backgroundColor = 'red';
return false;
} else return true;
}
function raschet(form){
var visota = form[0], shirina = form[1],
checkResult = [check(visota), check(shirina)];
for(var i = 0; i < checkResult.length; i++) if(!checkResult[i]) return NaN;
form[3].value=visota.value * shirina.value;
}
</script>