Aside from that approach, there are two other options if you don't want to 
have to create a custom form in the view. First, you can define a custom 
widget for a given field:

db.define_table(...,
    Field('myfield', ..., widget=lambda f, v: SQLFORM.widgets.radio.widget(f
, v, _accesskey='x')),
    ...)

That won't help with the submit button, but the second option is to use 
server-side DOM manipulation:

form.element('[type=submit]').update(_accesskey='s')

And for an input field:

f.element('[name=myfield]').update(_accesskey='x')

Anthony

On Thursday, June 30, 2016 at 10:05:07 AM UTC-4, Marlysson Silva wrote:
>
> Try use custom.form, and you add some property: 
>
> form.custom.widget.field_name["_accesskey"] = "some_key"
>
> Em quinta-feira, 30 de junho de 2016 10:22:58 UTC-3, [email protected] 
> escreveu:
>>
>> How do I define HTML accesskeys (keyboard shortcuts) for a form, so the 
>> user can quickly enter data without the mouse? 
>>
>> I want to enable shortcuts for two elements: a list:string (rendered as 
>> RADIO) and the submit button. The list always has exactly three choices, 
>> and the form is rendered simply as {{=form}}.
>>
>> I am using web2py 2.14.6
>>
>

-- 
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/d/optout.

Reply via email to