2

I am working on a multilingual layout. What worries me is:

How to handle text-input the right way?

I've build a JSFiddle to explain my problem.

  1. If I just add dir="rtl", the words appear from right to left, but not each character
  2. If I add the CSS style for right-to-left, the included numbers are also turned around

How can i combine numbers and text, so a hebrew input is showing correctly?

ohboy21
  • 4,259
  • 8
  • 38
  • 66

1 Answers1

4

You can try this solution from here

Example http://jsfiddle.net/0w5rydrL/1/

The html

<div class="text_direction" dir="rtl">
    <input type="text" onkeyup="rtl(this);" />
</div>

The javascript function

function rtl(element){   
    if(element.setSelectionRange){
        element.setSelectionRange(0,0);
    }
}
Community
  • 1
  • 1
Bojan Petkovski
  • 6,835
  • 1
  • 25
  • 34