auth.login() and form.custom field access

110 views
Skip to first unread message

Dutch opera

unread,
Aug 8, 2009, 10:28:06 AM8/8/09
to web2py-users
Hi,

I am trying to style the auth.login() fields and access them
indivialuall so I can place them in separate div tags.

in the html I tried

form.custom.label.email
form.custom.label.password

Seemed to work. What about the widget type? using
form.custom.input.email gave me this error

AttributeError: 'NoneType' object has no attribute 'email'

How do I also access the submit widget? e.g. form.custom.submit...

Thanks

Fran

unread,
Aug 8, 2009, 10:35:15 AM8/8/09
to web2py-users
On Aug 8, 3:28 pm, Dutch opera <dutchop...@gmail.com> wrote:
> I am trying to style the auth.login() fields and access them
> indivialuall so I can place them in separate div tags.
> in the html I tried
> form.custom.label.email
> form.custom.label.password
> Seemed to work.  What about the widget type?  using
> form.custom.input.email gave me this error
> AttributeError: 'NoneType' object has no attribute 'email'

form.custom.widget.email

> How do I also access the submit widget?  e.g. form.custom.submit...

Yes: form.custom.submit

F

Dutch opera

unread,
Aug 8, 2009, 10:36:58 AM8/8/09
to web2py-users
PS...

I tried the following..

<input type="text" value="{{=form.custom.inpval.email}}"/>
<input type="password" value="{{=form.custom.inpval.password}}"/>


This the correct?

If so...all that is left to do is to get the submit widget. How do I
do that?

Thanks

Dutch Opera

unread,
Aug 8, 2009, 11:16:27 AM8/8/09
to web...@googlegroups.com
Oh...widget is literal...lol....

I added

<form method=post/>
{{=form.custom.widget.email}}
{{=form.custom.widget.password}}
{{=form.custom.submit}}

</form>

but...would not work...just brought be back to the login page.  form {{=form}} works...

Dutch opera

unread,
Aug 8, 2009, 12:00:48 PM8/8/09
to web2py-users
Thanks
I just added I justed added {{=form.hidden_fields()}} and it
worked...and it worked..yeah...

mdipierro

unread,
Aug 8, 2009, 12:12:18 PM8/8/09
to web2py-users
If you use

{{=form.custom.begin}}
{{=form.custom.widget.email}}
{{=form.custom.widget.password}}
{{=form.custom.submit}}
{{=form.custom.end}}

you do not need to add the hidden fields.
Reply all
Reply to author
Forward
0 new messages