That code looks correct. Do you have JavaScript selected rather than FormCalc? Did you tab out of the field rather than select somewhere else with the mouse?
That code will work for a text field, but not a numeric field. For a text field, the rawValue is a JavaScript String object, which has a length property. That is unless the field is empty, in which case it contains null, which you should test for in your code. A numeric field returns an integer or a float, depending on how you've got it configured.
Thank you for your replies - I use javascript because that's what i'm used to using(from AcroForm days) for calculations / validations.. even though things do not work as i had hoped..
That the code will work for a text field & not numeric field: that's probably the reason, .. Yes.. I tried now.. i guess checking for a value not to be null is the best solution (which will work for both types of fields)