HOW to unseen Password when user is typing

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 12:07 am

Hi,all!

When user is entering password, I'd like to make what user types as ****** so that it wouldn't be seen by others.
What should I do to achieve this?

Besides,when the keyboard on iPhone comes out, it might cover the lines that the user is currently typing therefore user can't see what he has typed.
How to solve this problem?

Thanks!
I am completely new to LiveCode and want to make some apps by myself to impress my friend.

Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: HOW to unseen Password when user is typing

Post by Simon » Sun Aug 25, 2013 12:20 am

Hi Michael,
For the first question look up "keyDown" in the dictionary.
It's a fun exercise, but if you need more help just ask again.

The second question is solved by:
put the effective working screenRect into tRect
tRect now contains the viewable screen area, you use that to re-position your field.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10062
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: HOW to unseen Password when user is typing

Post by FourthWorld » Sun Aug 25, 2013 12:29 am

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 12:29 am

Simon wrote:Hi Michael,
For the first question look up "keyDown" in the dictionary.
It's a fun exercise, but if you need more help just ask again.

The second question is solved by:
put the effective working screenRect into tRect
tRect now contains the viewable screen area, you use that to re-position your field.

Simon
Thanks, Simon.
The second question, what do you mean? Should I put the sentence into script or what?

I am a noobie, sorry, I only understand the front-end work, not the coding part.

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 12:32 am

It seems the password there is about to teach you how to give stack a password. Not how to unseen some text... But thanks anyways...

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: HOW to unseen Password when user is typing

Post by Simon » Sun Aug 25, 2013 12:33 am

Richards answer solved both for you in 1 go. :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 12:47 am

Simon wrote:Richards answer solved both for you in 1 go. :)

Simon
All right. I see "ask password" this time.

But what do I write in the script to make this field ****
I tried ask password of Field "Password"
It doesnt work...
Last edited by ECNU4271 on Sun Aug 25, 2013 12:54 am, edited 1 time in total.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: HOW to unseen Password when user is typing

Post by Simon » Sun Aug 25, 2013 12:51 am

It's "ask password"

Code: Select all

on mouseUp
   ask password "Please enter the administrator password." 
   if it is empty then exit to top
   if it = the uPassword of this stack then --uPassword  contains the correct password
      # right password; proceed
   else
      # incorrect password
      answer "Incorrect password. Please try again."
   end if
end mouseUp
Just put that in a button you'll see.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 1:00 am

Simon wrote:It's "ask password"

Code: Select all

on mouseUp
   ask password "Please enter the administrator password." 
   if it is empty then exit to top
   if it = the uPassword of this stack then --uPassword  contains the correct password
      # right password; proceed
   else
      # incorrect password
      answer "Incorrect password. Please try again."
   end if
end mouseUp
Just put that in a button you'll see.

Simon

Thanks Simon.

I tried. It works very well if there is only an admin needs to log in.
The field appears in the Register page. So the password field, I want it to be unseen. not the button or verification.
Same as the password field in the Login page.

How would this work?

Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: HOW to unseen Password when user is typing

Post by Simon » Sun Aug 25, 2013 4:34 am

Not sure I follow you.
Are you asking about the first time someone writes their password?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 1:15 pm

Simon wrote:Not sure I follow you.
Are you asking about the first time someone writes their password?
Yeah, when a user wants to sign up, he needs to enter the password, that's where I want the information unseen.

Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: HOW to unseen Password when user is typing

Post by Simon » Sun Aug 25, 2013 1:29 pm

Use the same ask password in the code but instead of "if it =" use "put it somewhere". (somewhere is not a LC function, it's just a var or field or file, you choose (Wow the trouble with an English-like language))
The "it" variable contains anything they typed.

Do you know how to to use "breakpoint" and step through the code? Breakpoint allows you to watch what is happening in the variable watcher when each line executes. I only add this because I figure you ran the code but never saw what was happening.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 3:02 pm

Simon wrote:Use the same ask password in the code but instead of "if it =" use "put it somewhere". (somewhere is not a LC function, it's just a var or field or file, you choose (Wow the trouble with an English-like language))
The "it" variable contains anything they typed.

Do you know how to to use "breakpoint" and step through the code? Breakpoint allows you to watch what is happening in the variable watcher when each line executes. I only add this because I figure you ran the code but never saw what was happening.

Simon
OK, I understand what you mean. But the password should be on a blank that needs to be filled in. (Like this: Password: ______)
There is no button, how can I make use of mouseUp anyway?

Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: HOW to unseen Password when user is typing

Post by Simon » Sun Aug 25, 2013 3:25 pm

Hey Michael,
I'm guessing English is not your first language? No problem, but this will take longer. (Do you use an online translator, would be cool to see how good they are translating to English).

You are building a registration form that has a few fields that need filling out (e.g. first name, last name, phone) and in that you want to allow the user to enter a password?

With that I see how "ask password" is not like other registration forms, but it can be used on subsequent visits.

If that is the case then again look up "keydown" in the dictionary. You intercept the keydown and replace it with "*" in your password field. Please try it first using a breakpoint and step through the code, see if you can figure it out.

The keyboard covering up the field is another problem, one thing at a time.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: HOW to unseen Password when user is typing

Post by ECNU4271 » Sun Aug 25, 2013 3:39 pm

Simon wrote:Hey Michael,
I'm guessing English is not your first language? No problem, but this will take longer. (Do you use an online translator, would be cool to see how good they are translating to English).

You are building a registration form that has a few fields that need filling out (e.g. first name, last name, phone) and in that you want to allow the user to enter a password?

With that I see how "ask password" is not like other registration forms, but it can be used on subsequent visits.

If that is the case then again look up "keydown" in the dictionary. You intercept the keydown and replace it with "*" in your password field. Please try it first using a breakpoint and step through the code, see if you can figure it out.

The keyboard covering up the field is another problem, one thing at a time.

Simon
Thanks for your kind understanding, Simon!

I tried
on keyDown
intercept the keydown and replace it with "*" in field "password"
end keyDown

Obviously, error at line2...

Post Reply