Native textField.isSecure property doesn't appear to work

Has anyone gotten this to work?   Right now it behaves just like a normal text field to me, but I need this text field to behave like a password field and conceal what’s being entered.  Using the latest daily build.

Thanks,

Nate

Don’t know how Atanas implemented this in the widget.newEditField but it works perfectly there. You might want to give the beta code a try and see if this works for you. 

http://forums.coronalabs.com/topic/42977-widgetneweditfield-beta-testers-needed/

It works as I’ve recently used it in an app.  Can you post some code where you’re trying to set it up.

Rob

Interesting about the widget solution - will have to check that out.  Would like to though stay native here.  This is on an iPad-only app… This form is part of a form that has 5 native textFields, two of which should be secure (password and password confirm).

input = native.newTextBox(x, y, w, h) input.font = native.newFont(fonts.italic, 16) input.isEditable = true input.hasBackground = false input.isSecure = true input.text = self:getPlaceholder() input:addEventListener( "userInput", function(event) self:listener(event) end)

In the above code, the fonts.italic is a custom font and works great.  The getPlaceholder() call just fills the textfield with the word “password” which technically should be “••••••••” but comes up as “password”.  Editing the field doesn’t change to bullets.

The widget solution uses native.newTextFields() under it’s hood. 

Can you try it without setting the placeholder? 

From a usability point of view, if I see a password field that has bullets in it, I’m assuming that’s a saved version of my password and I should not have to change it.  Hopefully my password isn’t password.  So setting a placeholder on the field tells it you want to show what’s there and that could be messing with the .isSecure setting.   Maybe you could try setting the .isSecure after setting the text, setting the text to their password if you’re saving it, or try setting it to .isSecure in the began phase of editing it.

Rob

My bad!!!   I was using native.newTextBox() instead of newTextField().   Had the height set to the proper height w/o field background so I couldn’t tell the difference.  Can’t believe I hadn’t caught that yet!!!  Thanks for your help Rob :wink:

Don’t know how Atanas implemented this in the widget.newEditField but it works perfectly there. You might want to give the beta code a try and see if this works for you. 

http://forums.coronalabs.com/topic/42977-widgetneweditfield-beta-testers-needed/

It works as I’ve recently used it in an app.  Can you post some code where you’re trying to set it up.

Rob

Interesting about the widget solution - will have to check that out.  Would like to though stay native here.  This is on an iPad-only app… This form is part of a form that has 5 native textFields, two of which should be secure (password and password confirm).

input = native.newTextBox(x, y, w, h) input.font = native.newFont(fonts.italic, 16) input.isEditable = true input.hasBackground = false input.isSecure = true input.text = self:getPlaceholder() input:addEventListener( "userInput", function(event) self:listener(event) end)

In the above code, the fonts.italic is a custom font and works great.  The getPlaceholder() call just fills the textfield with the word “password” which technically should be “••••••••” but comes up as “password”.  Editing the field doesn’t change to bullets.

The widget solution uses native.newTextFields() under it’s hood. 

Can you try it without setting the placeholder? 

From a usability point of view, if I see a password field that has bullets in it, I’m assuming that’s a saved version of my password and I should not have to change it.  Hopefully my password isn’t password.  So setting a placeholder on the field tells it you want to show what’s there and that could be messing with the .isSecure setting.   Maybe you could try setting the .isSecure after setting the text, setting the text to their password if you’re saving it, or try setting it to .isSecure in the began phase of editing it.

Rob

My bad!!!   I was using native.newTextBox() instead of newTextField().   Had the height set to the proper height w/o field background so I couldn’t tell the difference.  Can’t believe I hadn’t caught that yet!!!  Thanks for your help Rob :wink: