On Monday, January 12, 2015 at 7:59:38 PM UTC-8, Dave S wrote: > > > > On Monday, January 12, 2015 at 7:26:42 PM UTC-8, Dave S wrote: >> >> >> >> On Monday, January 12, 2015 at 5:45:43 PM UTC-8, Dave S wrote: >>> >>> I'm trying to write a custom validator to use in a form, and I'm >>> thinking it should be simple but the brick wall is leaving dents on my >>> forehead. >>> >>> [...] >> >>> In my controller: >>> def activate(): >>> form = FORM('Activation code:', >>> INPUT(_act1='left', requires=[IS_NOT_EMPTY(), IS_HEXSTR >>> ()], _width=4), >>> INPUT(_type='submit')) >>> if form.process().accepted: >>> response.flash = 'congratulations' >>> elif form.errors: >>> response.flash = 'form has errors' >>> else: >>> response.flash = 'pretty please fill the form' >>> return dict(form=form) >>> >>> >>> >>> >> Gah, pfooey! I shouldn't change"_name" to "_act1", should I? >> >> > > Also, it seems I want to change the "size" of the input field, not the > "width". But I don't see > _size=4 > working for me. How should I do this? > > It looks like Boostrap is beating me here, forcing the width to 300px. If I change the _type to number, then I get a width of 206px (still bigger than "size=4" should be), and it breaks my input because someone (browser?) assumes a number is decimal.
/dps -- 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.