How to hide password text?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
scott47303
Posts: 17
Joined: Tue Aug 10, 2010 3:16 pm

How to hide password text?

Post by scott47303 » Tue Aug 10, 2010 3:21 pm

I cannot figure out how to do it. I want * to display when the user types in the field, how do you do this?

Thanks.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to hide password text?

Post by Klaus » Tue Aug 10, 2010 3:35 pm

Hi Scott,

its all buit in :-)
...
ask password clear "Please enter password:"
if it <> empty then
## IT contains the password that the user entered
## and you can now check it
## If the user hit "cancel" the variable IT will be empty!
end if
...

Best

Klaus

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to hide password text?

Post by Mark » Tue Aug 10, 2010 4:44 pm

Hi scott47303,

If you would like to make your own password field, here's a widget for you. The stack is called "Password Field". Scroll down to 1/3rd of the page.

Best,

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

scott47303
Posts: 17
Joined: Tue Aug 10, 2010 3:16 pm

Re: How to hide password text?

Post by scott47303 » Tue Aug 10, 2010 5:14 pm

Mark, that is exactly what I was looking for, thanks! Wow, thats alot of code for something that sounds simple.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to hide password text?

Post by Klaus » Tue Aug 10, 2010 5:24 pm

Hi Scott,

sorry I overlooked "... when the user types into a field".
So Marks widget is the way to go.

And yes, lots of scripting involved :)


Best

Klaus

Curry
Posts: 111
Joined: Mon Oct 15, 2007 11:34 pm
Contact:

Re: How to hide password text?

Post by Curry » Tue Aug 10, 2010 10:32 pm

If password text is hidden when creating a new one, it's a good idea to enter twice and compare the two. It's too easy to make a small mistake and never notice.
Best wishes,

Curry Kenworthy

LiveCode Development, Training & Consulting
http://livecodeconsulting.com/

WordLib: Conquer MS Word & OpenOffice
SpreadLib: "Excel-lent" spreadsheet import/export
http://livecodeaddons.com/

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to hide password text?

Post by Mark » Tue Aug 10, 2010 10:48 pm

Hi Curry,

That only applies if the password field is used for changing or creating a (new) password. If the field is only used to give access to a protected part of a stack, then one password field should be sufficient.

My widget could be added to a card twice, without any problem. The userpassword properties of the two fields could be compared to test the validity of a new password.

Best 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

Curry
Posts: 111
Joined: Mon Oct 15, 2007 11:34 pm
Contact:

Re: How to hide password text?

Post by Curry » Tue Aug 10, 2010 11:37 pm

That's right, only twice when creating a new one!
Best wishes,

Curry Kenworthy

LiveCode Development, Training & Consulting
http://livecodeconsulting.com/

WordLib: Conquer MS Word & OpenOffice
SpreadLib: "Excel-lent" spreadsheet import/export
http://livecodeaddons.com/

QuangNgo
Posts: 60
Joined: Thu Mar 31, 2011 8:31 am

Re: How to hide password text?

Post by QuangNgo » Mon Apr 11, 2011 8:53 am

Hi mark

That is a lot of code for simple thing. In the visual studio this problem is quite easy.So sorry to say that.
So is there any other solution to do that?.

Quang

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to hide password text?

Post by Mark » Mon Apr 11, 2011 10:10 am

Hi Quang,

There are simpler solutions, but those are less secure or less flexible and you'd still have to add a lot of code to fix that. I'm not saying that my solution is perfect, it could still be improved, but that would require the addition of even more code :wink:

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

Post Reply