There are a few ways but this should do it:

form.custom.widget.txtUserName['_id'] = 'new_id'

You should be able to set other attributes in the same way.

On Sep 21, 7:10 pm, Arvind <arvind.ran...@gmail.com> wrote:
> Hello,
>
> I am using this in my view
> {{=form.custom.widget.txtUserName}}
>
> and the controller's code is
>     form = SQLFORM.factory(
>             Field('txtUserName',requires=IS_NOT_EMPTY()))
>
> I see that the id for this input field is automatically generated as
> no_table_txtUserName
>
> How can I set this myself ?
>
> Also, how can i set other attributes of the <INPUT> element , like
> class and onfocus, onclick etc.
>
> thanks
> Arvind
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to