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

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 b

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 I

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 > > >var success = true; >var creditCardType = widget.lookupWidget("credi

Widget javascript validation problem

2006-07-05 Thread Andrew Madu
Hi,I am having an issue with a widget form validation under cocoon 2.1.8. Basically what I have is a selection box with various credit card types, (visa, matercard...) etc, and based on the card selected a check is done on the credit card number field to make sure that the number of digits entered