“忘记密码”按钮通过以下方式添加到默认登录表单中:
<div id="web2py_user_form">
{{
...
if not 'request_reset_password' in auth.settings.actions_disabled:
form.add_button(T('Lost Password'),
URL(args='request_reset_password'),
_class='btn')
pass
...
=form
}}
如何将其从按钮更改为html超链接呢?同样最好我想要链接在“登录”和“注册”按钮的单独行上。
答案 0 :(得分:0)
通过查看add_button的源代码,我知道如何执行此操作:
<div id="web2py_user_form">
{{
...
if not 'request_reset_password' in auth.settings.actions_disabled:
submit_button = form.element('input[type=submit]')
submit_button.parent.append(DIV(A(T('Lost Password'),
_href=URL(args='request_reset_password'))))
pass
...
=form
}}