Password Field

Mark Brownell gizmotron at earthlink.net
Mon Jan 19 20:53:30 EST 2004


On Monday, January 19, 2004, at 05:08  PM, Brian Maher wrote:

> Hi Folks,
>
> Does anyone have code that they would be willing to share that allows 
> a user to enter a password into a text field and visually what they 
> enter appears as some other character (blanks, dots, ...)?
>
> Thanks, Brian

You are welcome Brian.

I figured this one out reading two how-to-do recipes in the docs. It 
only took ten minutes.

on keyDown theKey
   global holdPassword
   if the length of me >= 8 then
     answer "Now you know how long the password is :-)"
     exit keyDown
   else
     if "abcdefghijklmnopqrstuvwxyz1234567890" contains theKey then
       put theKey after holdPassword
       put "*"  after field "textbox"
     else
       put empty into holdPassword
       put empty into field "textbox"
       answer "Start over. You just used the wrong key"
       exit keyDown
     end if
   end if
end keyDown

Mark Brownell



More information about the use-livecode mailing list