How to add multiple onvalidation

28 views
Skip to first unread message

Rahul

unread,
Jun 2, 2021, 5:35:32 AM6/2/21
to web2py-users
Hi All,
         It may be simple one but I want to know how to add multiple onvalidation functions/methods in my code. For example If I want to check for userlimit reached for users before adding one as well as want to check for duplicate users for the same form which exists in other function. 

form = SQLFORM(db.numbers)
if form.process(onvalidation=my_form_processing).accepted:
      do something .... 

def my_form_processing(form): 
       do something ... 

Regards,

Rahul

Rahul

unread,
Jun 2, 2021, 7:57:03 AM6/2/21
to web2py-users
Nevermind, 
           I was able to achieve that using nested functions. Thanks!

Rahul

Reply all
Reply to author
Forward
0 new messages