Thanks Man,
  Working fine with me.

On Monday, 2 March 2015 03:25:22 UTC+5:30, Leonel Câmara wrote:
>
> Turns out you're right, here's a possible workaround:
>
> def register():
>     db.purchase.coupon_code.show_if = (db.purchase.have_coupon == 
> 'Individual')
>
>     form=SQLFORM.factory(db.client,db.address,db.purchase)
>     form.element(_id='no_table_coupon_code')['_data-show-trigger'] = 
> 'no_table_have_coupon'
>     if form.accepts(request.vars):
>         id = db.client.insert(**db.client._filter_fields(form.vars))
>         form.vars.client=id
>         id = db.address.insert(**db.address._filter_fields(form.vars))
>         response.flash='Thanks for filling the form'
>     return dict(form=form)
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to