At a glance it looks like *account_no.setValidationError* is wrong as you declared the variable as *accountNumberLength*. This is why I like strict type checking.
that now works fine now. I remember having done the same mistake a while ago, and was trying to chek against the actual widget id I specified in fd:widgets instead of against the _javascript_ values holding the lookupWidget objects!!!
The other problem I am having is with the widget datatype definition for account_no:
fd:datatype base="integer"
Does this actually do what it should do? I enter an alpanumeric value of '12der456' and when you submit the form it accepts the value as valid!!!, when it quite clearly isn't. What is the issue here? If I enter 'der12456' then the value is rejected as invalid. I entered the following code in the _javascript_ validation but this as well had no effect:
if (isNaN(parseInt(account_no.value))) {
account_no.setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("The value entered is not a numeric number. Please re-enter the number.", false));
success = false;
}
regards
Andrew