Tutto e` possibile:

var num = document.NOMEFORM.NOMECAMPO.value;
if(parseFloat(num) > 300) {
alert("troppo grande");
return false;
} else {
return true;
}

Ciao
Michele