Hi,
i need to know how to do check on a option check
this is the code i using
def results():
form = FORM(
TABLE(*[TR("Result "+str(id['id']), INPUT
(_type="checkbox",_name=str(id['id']),value=False,_value='on'))
for id in cynotedb().select(cynotedb.result.id)]+\
[TR("",INPUT(_type="submit",_value="SUBMIT"))]))
id_list = []
if form.accepts(request.vars,session):
session['form_vars'] = form.vars
option_checked = [id['id'] for id['id']in form.vars.keys() if
form.vars[id['id']]]
redirect(URL(r=request,f='show_out'))
return dict(records=records,form=form)
def show_out():
#print option_checked
return dict(result=session['form_vars'])
what the results html will show is something like this
[]Result 1
[]Result 2
Result 1
Hi, There!
Result 2
Bye!
if i click check on result 1 and click submit
it'll show what i check
if i check both of them
then after submit it will show both result
however i do not know how to return the option_checked to show_out
and i do need some help
*do pardon my English*
Thanks and Good day
Madwalker
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---