> How do you add the data toggle, data target, etc. as well? 
>

I had the same problem, Anthony helped me solve it:


See the end of this section in the book: 
http://web2py.com/books/default/chapter/29/05#HTML-helpers

And specifically for "data-*" attributes, you can now do:

form.element('input[id=what3]').update(
    data={'content':'My text', 'toggle':'popover', 'original-title':'My 
title'}, _title='')

HTML helpers can now take a "data" argument, which is a dict -- the keys of 
the dict will be transformed into HTML attributes of the form "data-[key]".

Note, if the helper already has a "data" argument and you want to add more 
data-* attributes, you would update the "data" dict itself, as follows:

form.element('input[id=what3]')['data'].update(newattribute='newvalue')


I hope Anthony's reply helps you solve the problem.


Kind regards,

Annet

-- 
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/groups/opt_out.

Reply via email to