Hi all,

have some troubles with web form which have more than one button. It is
obvious that one button (action connected with button) correspond with
one function.

According manual this should work:
controler
---------
def index():
  form = FORM('blah blah',
        INPUT(_type='submit', _value='Apply'),
        INPUT(_type='submit', _value='Reset', _action=URL(r=request,
f='reset'),
        INPUT(_type='submit', _value='Reset all', _action=URL(r=request,
f='reset_all'))
  if form.accepts(request.vars, session):
        pass
  elif form.errors:
        response.flash = 'Error'
  else:
        pass
  return dict(form=form)


def reset():
    if form.accepts(request.vars, formname=None):
        response.flash = 'Reset'
    elif form.errors:
        response.flash = 'Error'
    else:
        pass
    return dict()


def reset_all():
    if form.accepts(request.vars, formname=None):
        response.flash = 'Resert all'
    elif form.errors:
        response.flash = 'Error'
    else:
        pass
    return dict()

But action functions (reset, reset_all) will not call. Am I doing
anything wrong?

Thanks for advice,
cheers

-- 
Tom

Key fingerprint = 06C0 23C6 9EB7 0761 9807  65F4 7F6F 7EAB 496B 28AA

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.

Reply via email to