javascriptphppasswordsright-to-leftleft-to-right

RTL passwords copy/ pasting issue


I'm developing a portal in RTL language with a password generator in php/ javascript that generates randomly passwords like

F1O=a@9@ 

or

7$kf8F=og!$ 

However if i paste such passwords with special chars into the RTL field they are completly wrong.

A fiddle of the issue can be found HERE.

How to overcome such an issue? Excluding special chars in passwords is not an option as it would decrease security.

Thanks for any hint in advance.


Solution

  • Thats how it works, if you simply want text on the right, use css instead.

    <style>
      input[type="text"] {
        text-align: right
      }
    </style>
    
    <label>RTL FIELD</label>
    <input type="text" value="">