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:
How do you add the data toggle, data target, etc. as well?
For example:
form.element(_type='submit')(['_class']='btn
btn-default',['_data-toggle']='modal',['_data-target']='.bs-example-modal-lg')
but that doesn't work...
On Friday, July 6, 2012 12:06:30 PM UTC-5, Annet wrote:
To change
This works for me:
In web2py_ajax.html:
response.files.insert(3,URL('static','js/bootstrap.min.js'))
response.files.insert(4,URL('static','css/bootstrap.min.css'))
and in the function:
form=SQLFORM(..)
form.element(_type='submit')['_class']='btn btn-primary'
Il 06/07/2012 10:52, Annet ha scritto:
This works for me:
but not for me :(
my web2py_ajax.html (I tried several changes):
...
{{
response.files.insert(0,URL('static','js/jquery.js'))
response.files.insert(1,URL('static','css/calendar.css'))
and this change a lot of things but not buttons style, so I think that's
not the corrects way ...
Not sure if it would solve your problem, but sometimes you need to clear
the browser cache to see the effect of changes in css.
Il 06/07/2012 10:31, orsomannaro ha scritto:
In a SQLFORM form I set:
buttons = [
INPUT(_type='submit', _value='go', _class='btn btn-primary'),
INPUT(_type='button', _value='info', _class='btn btn-info'),
]
but buttons have not bootstrap style (btn-primary button are not blue,
there are no
To change the value of a button, this should work:
form.element(_type='submit')['_value']='Login'
To add the info button:
form[0][-1][1].append(INPUT(_type=button,_value=Info,_onclick=document.location='%s'
%URL('function')))
To add the classes:
form.element(_type='submit')['_class']='btn
7 matches
Mail list logo