How to hide a password?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
- Location: Khanom, Nakhon Si Thammarat, Thailand
- Contact:
How to hide a password?
Greetings:
I am developing an app which begins with a user having to login with a username and password.
I can't find any way to hide the password, with blobs or asterisks or something.
I've found links to code which is supposed to do this, but haven't managed to find the code itself.
I'm kind of surprised that LiveCode doesn't have an option (maybe in the Inspector) to say "this is a password field."
I've found "ask password" but that's not quite what I want. I rather not have an answer box popping up, after the user has entered a user name.
Can someone steer me in the right direction please...
TIA
--paul
I am developing an app which begins with a user having to login with a username and password.
I can't find any way to hide the password, with blobs or asterisks or something.
I've found links to code which is supposed to do this, but haven't managed to find the code itself.
I'm kind of surprised that LiveCode doesn't have an option (maybe in the Inspector) to say "this is a password field."
I've found "ask password" but that's not quite what I want. I rather not have an answer box popping up, after the user has entered a user name.
Can someone steer me in the right direction please...
TIA
--paul
-
- Posts: 49
- Joined: Sat Jun 16, 2012 7:57 pm
- Location: City of God Lug
Re: How to hide a password?
Hi Paul,
AFAIK, ask password is the only build-in command allowing this in LC. If it doesn't suits you, you have to manage it yourself, using a keydown handler.
Maybe somebody has already written such a piece of code and will chime in.
Did you have a look at the User samples?
AFAIK, ask password is the only build-in command allowing this in LC. If it doesn't suits you, you have to manage it yourself, using a keydown handler.
Maybe somebody has already written such a piece of code and will chime in.
Did you have a look at the User samples?
Best regards,
Didier
Didier
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: How to hide a password?
Hi Paul,
It seems that is not easy to do it
some experiments here:
http://forums.runrev.com/phpBB2/viewtop ... ord#p56323
Best regards
Jean-Marc
It seems that is not easy to do it
some experiments here:
http://forums.runrev.com/phpBB2/viewtop ... ord#p56323
Best regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to hide a password?
Hi.
This has come up several times. I can't remember what happened.
Make a field named "f1". Put this into its script:
In a button somewhere, place this into its script:
You need to set the passWordData of that field (another custom property) to the string of your choice.
Do you see how it works? Do you see that using the "delete" key is not managed? What are we going to do about that?
Craig Newman
This has come up several times. I can't remember what happened.
Make a field named "f1". Put this into its script:
Code: Select all
on keydown var
put numToChar(161) after me
set the currentPassword of me to the currentPassword of me & var
end keydown
on mouseEnter
put "" into me
set the currentPassword of me to ""
end mouseEnter
Code: Select all
on mouseup
if the currentPassword of fld "f1" = the passWordData of fld "f1" then goAheadWithYourStuff
end mouseup
Do you see how it works? Do you see that using the "delete" key is not managed? What are we going to do about that?
Craig Newman
Re: How to hide a password?
Hi,
It is quite complicated to make a really good password field, but I think I've manage to make something that works. You can find it here, but a donation is required.
Kind regards,
Mark
It is quite complicated to make a really good password field, but I think I've manage to make something that works. You can find it here, but a donation is required.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: How to hide a password?
You could look at DropTools. One of the available tools is a password field. It's free and easy to add to your stack.
http://droptools.sonsothunder.com/produ ... ag-pw.irev
http://droptools.sonsothunder.com/moreinfo.irev
http://droptools.sonsothunder.com/all.irev
http://droptools.sonsothunder.com/produ ... ag-pw.irev
http://droptools.sonsothunder.com/moreinfo.irev
http://droptools.sonsothunder.com/all.irev
-
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
- Location: Khanom, Nakhon Si Thammarat, Thailand
- Contact:
Re: How to hide a password?
Thank you! That was what I found last week, failed to bookmark and couldn't relocate!wsamples wrote:You could look at DropTools. One of the available tools is a password field. It's free and easy to add to your stack.
http://droptools.sonsothunder.com/produ ... ag-pw.irev
http://droptools.sonsothunder.com/moreinfo.irev
http://droptools.sonsothunder.com/all.irev
--paul
-
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
- Location: Khanom, Nakhon Si Thammarat, Thailand
- Contact:
Re: How to hide a password?
Oh dear. Looks like I even downloaded it. More coffee needed.
--paul
--paul
-
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
- Location: Khanom, Nakhon Si Thammarat, Thailand
- Contact:
Re: How to hide a password?
Okay, that works a treat.
But, would you know how to clear the displayed password field? If a user enters an incorrect password, I'd like to clear out the asterisks.
I have tried ...
but this only clears the display, not the contents of the variable. So when the user enters a new password, it is concatenated onto the old one.
TIA
--paul
But, would you know how to clear the displayed password field? If a user enters an incorrect password, I'd like to clear out the asterisks.
I have tried ...
Code: Select all
put empty into fld "aagPasswordField"
TIA
--paul
-
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
- Location: Khanom, Nakhon Si Thammarat, Thailand
- Contact:
Re: How to hide a password?
Hmmm, I've just realized that to achieve what I need (YMMV) there's a very simple method...
I don't care about password encryption, I just don't want it to be visible on-screen. So, I created two Text Entry Fields, let's call them PW and AST.
I made them the same size, I placed AST directly on top of PW, and disabled it.
Then I put the flwg code into PW...
So the user actually types into PW but only sees the contents of AST, which contains asterisks.
That code could no doubt be more elegant but the solution works for me, and may help someone else.
--paul
I don't care about password encryption, I just don't want it to be visible on-screen. So, I created two Text Entry Fields, let's call them PW and AST.
I made them the same size, I placed AST directly on top of PW, and disabled it.
Then I put the flwg code into PW...
Code: Select all
on rawKeyUp
put "*********************" into t_stars
put the len of fld "PW" into t_len
put char 1 to t_len of t_stars into fld "AST"
end rawKeyUp
That code could no doubt be more elegant but the solution works for me, and may help someone else.
--paul
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: How to hide a password?
I've tried all kinds of methods, but the password field I like best right now is this one:
http://runtime-revolution.278305.n4.nab ... 90644.html
This method is very easy to implement, and automatically takes care of everything a user might type into the field including backspaces, select all, delete, typing over a selection, etc. You don't need any code at all for those things, the engine does it for you.
http://runtime-revolution.278305.n4.nab ... 90644.html
This method is very easy to implement, and automatically takes care of everything a user might type into the field including backspaces, select all, delete, typing over a selection, etc. You don't need any code at all for those things, the engine does it for you.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
- Location: Khanom, Nakhon Si Thammarat, Thailand
- Contact:
Re: How to hide a password?
Thank you Jacque, I'll try that...
--paul
--paul