makePassword (in draggable group)

Workarounds and usability notes.

makePassword (in draggable group)

Postby John Robin Dove » Fri Mar 23, 2018 4:17 am

Hi Clifton,

Being somewhat stubborn I have spent three days tryimg to make this work. If you think what I'm trying to do is impossible, don't waste any time on it.

I use a 'dummy message box' that is draggable and looks like this:
Image

I merge a group and a transparent field (which is below the group) like this:
Image

I also make one object in the group draggable like this:

Image

All this works well and I'm very satisfied with the result. It works more or less like the TB request/ask system. I would like it to be able to ask for passwords too but so far I haven't managed this. I have tried using one field in the group for normal ask and one for password ask using your makePassword script. I have tried using make password before and after page load. I have also tried using pgGotoURL and a separate html file. I thought this would work but it didn't. Both methods work in a regular non draggable field on the page but fail when this field is part of the draggable group. The symptoms are the same for both methods; the field cannot be seen and cannot receive the focus and significantly its left property becomes 0.

If you think making the password field in this draggable group is impossible, don't waste time on it. I shall have to settle for using a fixed password field.

John

UPDATE: Please ignore all this for the moment. I think I'm nearly there using the pgGotoURL method.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: makePassword (in draggable group)

Postby Clifton » Fri Mar 23, 2018 8:12 am

The function makePassword() is becoming a legacy function which I need to rewrite.
Why does makePassword() fail in your application?
    Essentially, the function clones a replacement element in the DOM. However, the replacement element is not likely to respond well to other dynamic functions which make modifications to the page (e.g.: mergeTBObjects()). I've left the function alone to maintain backwards compatibility, but moving forward the clone method is what is the gottcha here.
A better approach.
    Use userProperty() to change the "type" of the field to the value "password". In the past, non-HTML5 browser didn't handle this very well and that is why the clone method was used. However, now this is the better approach. Then you can use a simple get text of field action to retrieve the password entered.
    NOTE: For the type property to be settable to "password," the field must be either single line or no wrap. If a field with word wrap set is used, it will not convert because it is a <textarea> element when exported.

    These changes in your program will leave the original DOM element in place and modify it directly. Thus it will preserve the element for use in other functions like mergeTBObjects().
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: makePassword (in draggable group)

Postby John Robin Dove » Fri Mar 23, 2018 8:48 am

Hi Clifton,

Thanks for your suggestion. I have now got it to work using pgGotoURL and a separate html file. My request/ask group object contains 2 fields (amomgst other objects), 1 for entering text in the usual way and 1 for entering text as a password. These two fields are of identical size and also have an identical position. The field for entering text is a TB field with activated set to false(so I guess it becomes a textarea), the password field has activated set to true and uses pgGotoURL on page load to allow access to a password input on an html page. I discovered, by chance, that the first field, the one for entering normal text, was blocking access to the password field(even though it was hidden!?). If I move the first field out of the way, the second field becomes visible and functions as planned. However, I must admit your solution is far more satisfacory and I will try to use it.

John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron