Page 1 of 1

Loading Data into a field formatting

Posted: Tue Jun 03, 2014 10:25 am
by istech
Hi all,

I have a small issue I hope someone can solve. I have a local database which loads the hash passwords into a password field.

I would like for the field not to show the hash rather just bullet point it out.

As the data is not being typed but loaded keydown is not used. So what solution is there for this. Is there a handler that I can use to detect the

field is not empty and convert the text?

I have tried the password font direction and the hash still come through when loaded. Could someone point me in the right direction thanks all.

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 10:59 am
by bangkok
I'm not sure to understand what you want to do.

But you could do it just after you load the password from your database. Count the number of chars, and put the same number of "*" into a field...

Code: Select all

put empty into field "hiddenpassword"
repeat with i = 1 to the number of chars of tPassword
put "*" after field "hiddenpassword"
end repeat

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 11:13 am
by istech
Thanks bangkok,

That works perfectly from the "put" point of view thanks.

But is it possible to add a field script to do the same thing.

example:

field script:
on loaddata
repeat with i = 1 to the number of chars of me
---etc
end loaddata

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 11:20 am
by Simon
Hi istech,
How about setting the font of the field to... dingbats?

Simon
Edit: Or here make your own
http://forums.runrev.com/phpBB2/viewtop ... 25&p=96468

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 12:10 pm
by istech
Funny you should say that Simon.

As I tried it earlier and it was not working. But as soon as I posted I got it to work. (added space :( )

I would prefer not to have to install or load or rely on a external font. If possible but it does the job. :D

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 12:39 pm
by Klaus
Hi istech,

could you please explain, HOW your user will "load" the data?
I am sure you wrote that script, right? 8)

We surely can "hook" somewehre into the "load" routine!


Best

Klaus

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 4:17 pm
by istech
Hi Klaus,

Good day to you.

The data comes from a array. User selects a key and the data is populated into the fields.

I could do as bangkok or Simon says. But was just wondering if there was a "special handler/function" to detect data in the field and convert it. In any case the job gets done.

But always want to push the bounderires and learn something at the same time. I dont know to much about scripting fields so more about interest and learning than anything else. :wink:

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 4:52 pm
by dunbarx
Hi.

Have you checked out the "imageSource" property? By choosing a bullet as your image, you can "hide" all your text without actually changing that text.

Craig Newman

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 5:16 pm
by bangkok
istech wrote: The data comes from a array. User selects a key and the data is populated into the fields.

I could do as bangkok or Simon says. But was just wondering if there was a "special handler/function" to detect data in the field and convert it. In any case the job gets done.
I still don't understand your logic.

Since you launch a script that will load the data and populate the field... Why can't you directly act on this field, within the same script ?

Why do you want to "move" the task onto the field itself ? Since there will be no user interaction on this field ? ( the password will be displayed with bullets) ?

If your field would accept typing from the user, then of course, it would make sense to use a script within the field.

Re: Loading Data into a field formatting

Posted: Tue Jun 03, 2014 5:34 pm
by Klaus
Hi istech,
istech wrote:The data comes from a array. User selects a key and the data is populated into the fields.
OK, and HOW is this populated? By magic, witchcraft or a script you wrote? 8)

As bangkok said!

Hint: There is NO build-in function/message/handler that gets triggered when you put text into a field by script!


Best

Klaus

Re: Loading Data into a field formatting

Posted: Wed Jun 04, 2014 3:50 am
by dunbarx
You could easily write a handler that in fact does "send a message" when a field is changed by script, but this would be purely a matter of making LC bend to ones will.

As the others have said, changing the approach is more effective.

Craig Newman

Re: Loading Data into a field formatting

Posted: Thu Jun 05, 2014 1:49 pm
by istech
Thanks Craig, I have gone with the password font for now.

Thanks for everyones help. Any reading on field scripting or examples or links would be appeciated.

Have a nice day everyone.