The problem is that your backup stub script uses the field value to show the placeholder.
Password fields, of course, hide their meaning, so this method will fail in the password fields exactly as you described.
What you need is a placeholder script that works by writing placeholder text to an extra element that overlays on top of the field (or behind it if the background of the field is transparent). The script can then change this element, rather than changing the value of the field.
There are a number of scripts available that do just that: this one, for example (but there are many others).
Another option is to dynamically change the type of the field from password to text and vice versa each time the placeholder is switched. It might be faster to win to fit into your existing code, but I would recommend using a different technique instead in the long run.
Hope this helps.
source share