python 2.7 - How do I remove the * from a password field in a web2py password field. I only need it blank -


i have password field needs changes every once in while. have regular:

form = sqlform(db.table, id)

i want print form view following change: how stop web2py showing * symbols , show nothing @ user has enter new data every time editing form occurs.

currently shows ****** values of ****** in html.

do need make customer view issue? users getting confused form thinking still contains working password when doesn't.

you can customize widget of password field:

db.mytable.password.widget = lambda f, v: sqlform.widgets.password.widget(f, v, _value='') 

this can done in table definition:

db.define_table('mytable',     ...,     field('password', 'password',           widget=lambda f, v: sqlform.widgets.password.widget(f, v, _value='')),     ...) 

if want make change password fields in applications, can instead monkey patch sqlhtml module:

from gluon import sqlhtml sqlhtml.default_password_display = '' 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -