RE: Widget javascript validation problem

2006-07-05 Thread Stewart, Gary
-Original Message- From: Andrew Madu [mailto:[EMAIL PROTECTED] Sent: 05 July 2006 12:31 To: users@cocoon.apache.org Subject: Widget javascript validation problem fd:validation fd:javascript var success = true; var creditCardType = widget.lookupWidget(credit);

Re: Widget javascript validation problem

2006-07-05 Thread Andrew Madu
Gary,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

RE: Widget javascript validation problem

2006-07-05 Thread Stewart, Gary
-Original Message- From: Andrew Madu [mailto:[EMAIL PROTECTED] Sent: 05 July 2006 13:13 To: users@cocoon.apache.org Subject: Re: Widget javascript validation problem The other problem I am having is with the widget datatype definition for account_no: fd:datatype base=integer I've

Re: Widget javascript validation problem

2006-07-05 Thread Andrew Madu
Gary,if(!/^[0-9]{16}$/.test(account_no.value)) { //This is invalid } will match an account number with no spaces.many thanks for that heads up. All is working a treat now.regardsAndrew