I use in view:
form.element('#id_field')['_autofocus']=''
and i get:
<input autofocus id='id_field'>
like html5
Il giorno venerdì 9 agosto 2013 04:04:17 UTC+2, Anthony ha scritto:
>
> form.custom.widget.tm_home["_autofocus"]
>
> This is just standard Python, so the above simply attempts to retrieve the
> value with key "_autofocus" -- it doesn't add the key if it doesn't exist.
> Instead, you can do:
>
> form.custom.widget.tm_home["_autofocus"] = True
>
> which will yield:
>
> <input autofocus="autofocus">
>
> which should work.
>
> Anthony
>
> On Thursday, August 8, 2013 9:37:13 PM UTC-4, davedigerati wrote:
>>
>> using a custom sqlform, in my view I can use the placeholder attribute
>> but not the autofocus- is this being ignored by web2py?
>>
>> {{form.custom.widget.tm_home["_autofocus"]}}
>> {{form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
>>
>> I also tried autofocus without the _ with similar result: not rendering
>> in the html - no errors either which is weird because it seems like every
>> other thing I type generators an error of some kind ;)
>>
>> http://www.w3schools.com/tags/att_input_autofocus.asp
>>
>
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.