Ask Password and Login Screen

John Tregea john at debraneys.com
Fri Aug 19 10:47:12 EDT 2011


: )

Thanks I will modify my code too ...

-----Original Message-----
From: use-livecode-bounces at lists.runrev.com
[mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Peter M.
Brigham, MD
Sent: Friday, 19 August 2011 11:19 PM
To: How to use LiveCode
Subject: Re: Ask Password and Login Screen


On Aug 18, 2011, at 8:54 PM, John Tregea wrote:

> Hi,
> 
> I used a different approach to this question as the bulleted text font
> didn't seem that secure. The following code just traps the characters
> entered into a field and replaces them with "*" while storing the actual
> string into a global variable.
> 
> on openfield
>  global gThePass
>  put empty into gThePass
>    put empty into fld "password"
> pass openfield
> end openfield
> 
> on keydown thekey
>  global gThePass
>  put thekey after gThePass
>  put "*" after field "Password"
> end keydown
> 
> on backspacekey
>  global gThePass
>  put empty into fld "password"
>  put empty into gThePass
> end backspacekey
> 
> 
> on returninfield
>  global gTheUser
>  send mouseup to btn "Login"
>  exit returninfield
> end returninfield
> 
> The only downside is that if the user makes a mistake and types a
backspace
> they have to start all over again.

Just modify the backspace handler:

on backspacekey
    global gThePass
    delete char -1 of fld "password"
    delete char -1 of gThePass
end backspacekey

and it will work as you would expect.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig



_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1392 / Virus Database: 1520/3843 - Release Date: 08/18/11





More information about the use-livecode mailing list