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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---