*Multiple = False* IS_IN_SET(['a', 'b', 'c'], zero=T('choose one')) To unselect, click 'choose one' instead of whatever was selected.
*Multiple = True* Unselect/remove everything which was previously selected. ...then submit the form. On Saturday, 25 May 2019 01:32:23 UTC+1, jim kaubisch wrote: > > old posting, but have a related question - > > In a form dropdown, certainly multiple but probably under some > circumstances single, how do I un-select a previous choice without choosing > an alternative? Simple example is - currently I have chosen 3 elements of > the list, a, b, c and now want to unselect b without choosing an > alternative. i.e. I want the resulting list to be a,c (or even empty if I > unselect all three), but I see no way of doing that. The "single" case is I > have made a choice, now want to undo that choice, i.e. end up with an empty > list > > Am I missing something obvious? > > Thanks > > On Wednesday, January 30, 2013 at 2:41:16 AM UTC-8, Thomas Bellembois > wrote: >> >> Hello web2py community, >> >> I have a multiple select widget: >> >> db.PRODUCT.class_of_compounds.requires=[IS_EMPTY_OR(IS_IN_DB(db, >> db.CLASS_OF_COMPOUNDS.id, label=db.CLASS_OF_COMPOUNDS._format, >> multiple=True, sort=db.CLASS_OF_COMPOUNDS.label, zero='choose'))] >> >> The "zero" field does not appear. If I change multiple from True to >> False it appears. >> I have probably missed something in the documentation... >> >> How can a user then unselect an item ? >> >> Regards, >> >> Thomas >> > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/39fc5f8b-c120-41d7-b650-ffaa85163e0c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.