Making a password field (or how do I get index of selection)

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

Post Reply
kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Making a password field (or how do I get index of selection)

Post by kcorey » Wed Jan 18, 2012 7:04 pm

There are so many great things about LiveCode, I'm a bit mystified when I run across holes like the lack of a 'password' field (or more appropriately a 'password' option on a regular field).

That said, I've seen Mark's PowerTools package which provides a lot of power, including a password field. However, I noticed a strange thing: selections don't disappear when typing.

Normally with a field, if you double-click it, the whole field becomes selected. If you then type, the whole field is replaced.

So far so good, but what if only the last few characters are selected?

Let's say that the password I'm typing is 'chewChoo', but the password I should type is 'chewChew'. the field contains '11111111'. If I select the last two characters and start typing, the characters that are selected in the field are deselected and added to the end of the password. Bummer.

How do I find out the index of selectedText? I can't search for '11' because *all* characters are '1'.

Also, how to implement the 'x' functionality when the field is on iOS?

I've been experimenting with iphoneCreateControl, but so far no luck.

Thanks,

-Ken

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Making a password field (or how do I get index of select

Post by dunbarx » Wed Jan 18, 2012 11:47 pm

Not sure I get all that you said, but read up on "the selectedChunk".

Craig Newman

kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Re: Making a password field (or how do I get index of select

Post by kcorey » Thu Jan 19, 2012 1:10 pm

Hey Craig,

Thanks for that, it's exactly what I needed!

-Ken

Post Reply