Home > Archive > Programming with dBASE > April 2005 > Double blind entryfields









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Double blind entryfields
Winston Doyle

2005-04-08, 7:01 am

I need users to enter a serial number and then to re-enter, with the second entry matching the first. The second entry must be "invisible" or appear as asterisks to the user. Is there a picture or function property that I am missing?
Michael Nuwer [dBVIPS]

2005-04-08, 7:01 am

Winston Doyle wrote:
> I need users to enter a serial number and then to re-enter, with the second entry matching the first. The second entry must be "invisible" or appear as asterisks to the user. Is there a picture or function property that I am missing?



No, but you can use the following class:

/////// Custom Class: PasswordField ////////////////////////////////
/////// Purpose: Displays "*" and stores value to form.password
/////// andles, delete, backspace and chars only ////

class PasswordField(oFormo
bj) of Entryfield(oFormobj)


this.key = class::PW_Key

function PW_Key(nChar,nPositi
on,bShift, bControl)

pw = iif(type('form.password') # 'C','',form.password)
if nChar = 9 // <tab> or CUAEnter <Enter>
return false

elseif nChar = 8
////// BackSpace
pw = substr(pw,1,nPositio
n-2)+;
substr(pw,nPosition)

xreturn = true

elseif nChar = 127
////// Delete

pw = substr(pw,1,nPositio
n-1)+;
substr(pw,nPosition+
1)
xreturn = true

else
////// Character
pw = substr(pw,1,nPositio
n)+chr(nChar)+;
substr(pw,nPosition+
1)

xreturn = '*'
endif

form.password = pw
return xReturn

endclass


--
Michael Nuwer
http://www.nuwermj.potsdam.edu/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com