How to change Input Field 'Content Type' at runtime to toggle between asterisks and letters?

Hi all,

I have a password box set up in my project with the content type set to ‘Password’, so it shows asterisks when the user types in the box.
However I would like a toggle switch so the user can click to show the password characters if they like, so effectively toggling between ‘Password’ and ‘Standard’ - is this possible? Any pointers would be appreciated.

Unity 5.3.5 - PC Standalone.

Thanks in advance.

InputField have the contentType property.

See UI.InputField.ContentType for the possible values.