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
>
--
---
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.