Reputation: 4319
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.
dir="rtl"
, the words appear from right to left, but not each characterHow can i combine numbers and text, so a hebrew input is showing correctly?
Upvotes: 2
Views: 2977
Reputation: 6933
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);
}
}
Upvotes: 4