about setting the ID, I'm not sure. I just manually setting the ID but
it was ignored:
def test():
form = SQLFORM.factory(Field('name'))
if form.accepts(request.vars, session, dbio=False):
db.test.insert(id=33, name=form.vars.name)
return dict(form=form)
On Sep 22, 10:10 am, Arvind <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---