<script language="JavaScript">
function countit(form){
var wordCount = form.phrase.value.split(' ').length;
var price = parseFloat(form.pricePerWord.value) * wordCount;
form.priceResult.value = price.toFixed(5);
return false;
}
</script>
<form method="POST" onSubmit="return countit(this)" name="wordcount">
<input type="text" name="phrase" value="the .code inside" />
<input type="text" name="pricePerWord" value="0.003" />
<input type="text" name="priceResult" value="Результат" />
<input type="submit" />
</form>
ds [.code] опечатался, написал lenght вместо length.