Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow user to copy text from a password field

In my application there is a TEdit with PasswordChar = '*'.

When the user presses Ctrl + C a hint appears.

Screenshot of a Windows edit control in password mode showing its "cannot copy" balloon.

Translated:

Not Allowed

You cannot copy text from a password field.

And obviously, the Copy item in the drop-down menu is disabled

Screenshot of a Windows edit control in password mode with its context menu visible; the Copy item is disabled.

Is there a way to enable the copy action for password editors?

like image 916
Fabrizio Avatar asked Feb 27 '20 06:02

Fabrizio


People also ask

Is that possible to copy text from password field?

You cannot copy text from a password field.

How do you paste a password?

You press Ctrl+V to paste in the password.

What is the purpose of a password field?

As another security precaution, a password field stores its value as an array of characters, rather than as a string. Like an ordinary text field, a password field fires an action event when the user indicates that text entry is complete, for example by pressing the Enter button.


1 Answers

The usual way is to have a button right to the edit field allowing to display the password. This may be bound to some access conditions. While the password is visible it can be copied as well.

like image 56
Uwe Raabe Avatar answered Sep 22 '22 12:09

Uwe Raabe