well' This is a bug. I think the proper fix would be to edit html.py and make sure that only checked boxes display the error.
On Nov 21, 6:15 pm, "mr.freeze" <nat...@freezable.com> wrote: > Here's a lame workaround. It's a widget that removes all of the error > divs except the last one: > > def checkboxes_widget(f,v): > wrapper = DIV(_id="%s_wrapper" % f.name) > inp = SQLFORM.widgets.checkboxes.widget(f,v) > scr = SCRIPT('jQuery("div[id=\'%s__error\']").slice(0,-1).remove > ();' % > f.name,_type="text/javascript") > wrapper.components.extend([inp,scr]) > return wrapper > > On Nov 21, 3:45 pm, Thadeus Burgess <thade...@thadeusb.com> wrote: > > > form = SQLFORM.factory(Field('multiple_options', requires=IS_IN_SET(('Hi', > > 'Milk', 'Mom', 'Love', 'Santa')), widget=SQLFORM.widgets.checkboxes.widget)) > > > Submit the form without selecting anything, and it displays the error > > message on each INPUT() helper. > > > You can also change widget to SQLFORM.widgets.radio.widget and it will have > > the same effect. > > > -Thadeus > > > On Sat, Nov 21, 2009 at 3:35 PM, mr.freeze <nat...@freezable.com> wrote: > > > > Can you post some example code that produces the effect? Just want to > > > make sure I'm understanding the problem correctly. > > > > On Nov 21, 1:55 pm, Thadeus Burgess <thade...@thadeusb.com> wrote: > > > >http://static.thadeusb.com/web2py_checkboxes_fail.png > > > > > Pleeeeeeaze fix!!! > > > > > I have a patch, but it is not backwards-compatible. > > > > > Is this an area where it is a bug, or a feature to have multiple error > > > > messages for checkboxes/radio widgets? > > > > > -Thadeus > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---