Re: [web2py] Use IS_MATCH for optional form entry

2014-04-07 Thread chris_g
Thank you Johann, that worked for me. On Monday, April 7, 2014 4:52:34 PM UTC+10, Johann Spies wrote: > > On 7 April 2014 08:21, chris_g > wrote: > > >> How do I use IS_MATCH for field validation if the field only contains >> data? >> >> This works for me: >> IS_MATCH('^\d{10}', extract=True, err

Re: [web2py] Use IS_MATCH for optional form entry

2014-04-06 Thread Johann Spies
On 7 April 2014 08:21, chris_g wrote: > How do I use IS_MATCH for field validation if the field only contains data? > > This works for me: > IS_MATCH('^\d{10}', extract=True, error_message='Telephone number should > have 10 digits.') > > so long as a 10 digit number is required. > > But what if

[web2py] Use IS_MATCH for optional form entry

2014-04-06 Thread chris_g
How do I use IS_MATCH for field validation if the field only contains data? This works for me: IS_MATCH('^\d{10}', extract=True, error_message='Telephone number should have 10 digits.') so long as a 10 digit number is required. But what if I a want to make it acceptable to enter a 10 digit num