That's kinda clever. I may think of that! -- Joe
On Thursday, March 23, 2017 at 4:19:05 PM UTC-7, Anthony wrote: > > Note, you might as well also add 'type': 'string' to your dictionary, and > maybe 'length': 20. You can also give yourself some flexibility by creating > a function: > > def phone_field(name, **kwargs): > defaults = {'type': 'string', > 'length': 20, > 'requires': IS_EMPTY_OR(IS_PHONE()), > 'widget': lambda fld,val: SQLFORM.widgets.string.widget( > fld, val, _type='tel', _class='form-control')} > defaults.update(**kwargs) > return Field(name, **defaults) > > Anthony > > >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.