How do I get the text a user typed into an InputField of type Password in 4.6b19?

Hi!

I have an Input Field for a user to type in a password, i have the Input Type set to Password so that it shows up as asterisks and is hidden.

I need to send the password the user typed to a web service to authenticate the user, but when i get the .text property of that field it returns me the ACTUAL DISPLAYED text which is all asterisks, not what the user typed.

Is there a property i am not seeing that i can use to access what they actually typed or is this an bug in 4.6b19

According to the [documentation][1] there is no such thing as a text property. Do you mean the value property? Or have you stumbled upon an undocumented variable. [1]: http://docs.unity3d.com/460/Documentation/ScriptReference/UI.InputField.html

Have you looked into using GetComponent(UI.Text) ? If not I could search more for you if needed. Add that to a script and use in onClick event etc etc.

1 Answer

1

Ya, in code i was actually referencing my InputField by the Text component, not by the InputField component, so i was only looking at the view of the text, not the parent object.

User Error :slight_smile: