1

I am saving Twitter keys in a database. The 4 fields needed are in a place where more than one (at least semi trusted) person is able to add the required keys. However, it is suggested that you should not allow the keys to be visible in an application.

I want to show that the field has been completed, without showing the content of the field and still allowing users to overwrite the data if necessary.

I currently use the password field, however, this does not let other admins know that it is filled in. How would you show this without allowing the private keys to be copied?


As far as I can tell, you can't safely prefill a password field from the server side. You can set a value in the HTML but then it loses security as the user can grab the key from the page source.

See https://connect.sensiolabs.com/register/#registration_form

Try to register and fill out one password field. Submit it and you will be given your errors and your password will be gone.

3
  • 3
    Why doesn't the password field let other admins know it is filled in? Surely that field is either blank, or filled with ●●●●●'s? – JonW Oct 28 '14 at 11:44
  • @JonW I was thinking the same! :) – steve Oct 28 '14 at 11:54
  • Adding a color-coded status to the entry could clarify it's.. status. Whatever you feel like calling those statuses, thats for you to figure out. And I agree with @JonW the filled in password field does imply that a value has been entered. – Andrew Hoffman Oct 28 '14 at 19:27
3

What about using the method most websites or applications use for credit card information and show the last or first few characters of the values, with the rest as blobs or stars.

This could be in the placeholder attribute for a form field, or perhaps as normal text, with an edit button next to it, which swaps the text to a form field.

Try this fiddle for the general idea

0

+1 to Stephen's idea.
You could change the labeling on the field, based on the existence of the value. May not be as intuitive as treating it like a CC number, as mentioned above.

'Enter/Set key' when there is no value
'Change key' when there is a value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.