I just solve this by using

db.define_table('papers',
    Field('printdate','date'),
    Field('printout','boolean',default=False),
    Field('oncheck','string',default='on')) # this field for checkbox
value = 'on'

def test1():
    chkposts=[]
    posts=db(db.papers.id > 0).select()
    for pst in posts:
 
chkposts.append(DIV(INPUT(_type='checkbox',_name='pst_'+str(pst.id),requires=IS_NULL_OR(IS_IN_DB(db((db.papers.id
== pst.id ) & (db.papers.printout ==
False)),'papers.oncheck','',error_message=T('ALERT')))),str(pst.printdate)))
    # IS_NULL_OR for unchecked field which are not need to be
validated.
    chkposts.append(INPUT(_type='submit',_value='SUBMIT'))
    form=FORM(*[chkposts[num] for num in
range(len(chkposts))],_name="adcr")
    if form.accepts(request.vars, session):
        response.flash = 'form accepted'
    return dict(form=form)

Thanks
issue resolve (not quite pure solution, but i am satisfied)

Reply via email to