Thanks Denes! Your code suggestion worked for me. All I needed to do was the 'x in r' and it worked like a charm! :-)
On Mar 30, 10:25 pm, DenesL <denes1...@yahoo.ca> wrote: > On Mar 30, 7:00 pm, DJ <sebastianjaya...@gmail.com> 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'] > > Maybe something like: > > p=[INPUT(_type="checkbox",_name="resist_mult",_value=x,value=x in r) > for x in resist] > > <input name="resist_mult" type="checkbox" value="A" /> > <input checked="checked" name="resist_mult" type="checkbox" value="B" / > > <input checked="checked" name="resist_mult" type="checkbox" value="C" / > > <input name="resist_mult" type="checkbox" value="D" /> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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 -~----------~----~----~----~------~----~------~--~---