Here's what I want to do - be able to show/update selected values in a multiple checkbox form.
checkbox values come from a predefined table: ['A', 'B', 'C', 'D"] user settings (separate field) that have been saved are: ['A', 'C'] So when user wants to update his settings, I want to show A, C as selected; while B and D as unselected. Thanks! On Mar 30, 8:28 pm, mdipierro <[email protected]> wrote: > Sorry I do not understand what this is supposed to do. Can you explain > it in words. Could you also provide sample values for all the > variables? > > On Mar 30, 7:00 pm,DJ<[email protected]> wrote: > > > I would like someone to help me with the syntax. I want to show pre- > > selected values in a multiple checkbox form and want to insert this > > "if condition" in my FORM stmt. > > > resist = ['A', 'B', 'C', 'D'] > > r = ['B', 'C'] > > > if r == a.name: status="True" # condition to be included > > > #FORM stmt > > TR("Resistances:", *[TD(x.name, *[INPUT(_type="checkbox", > > _name="resist_mult",_value=x.name, value=status) for r in > > a.resist_mult.split('+')]) for x in db().select(db.resist.ALL)]), > > > Kindly let me know if you can do this or have any other solution. > > > thanks, > > Seb --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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 -~----------~----~----~----~------~----~------~--~---

