text direction right to left for arabic text input

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tarantulus
    New Member
    • May 2007
    • 114

    #16
    I think everybody is missing the point here, the gent is trying to get his CURSOR to move "in reverse" so he can type input the arabic way...

    unfortunately, I think this is impossible...

    the alt+shift thing is a windows language setup, and thus cannot be controlled from a browser window.

    EDIT: ActiveX perhaps, but thats IE specific, and VERY dodgy....

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #17
      Reverse? When text goes right to left, so does the cursor right?
      In RTL mode if i press c u r s e r I see in my textbox ressuc| where the | is my cursor. Everything is lined up to the right hand side. Opposite of left to right writing.

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #18
        Originally posted by Plater
        Reverse? When text goes right to left, so does the cursor right?
        In RTL mode if i press c u r s e r I see in my textbox ressuc| where the | is my cursor. Everything is lined up to the right hand side. Opposite of left to right writing.
        No, actually the Arabic languages are written from right to left like this
        ...E...D...C... B...A
        <-- <-- <--

        (of course they don't call it ABCD..)

        So what he (OP) exactly wants is.
        1. Text should be right aligned
        2. When a letter is typed, the cursor should come in the left of the recently typed letter, instead of right side of the letter.

        Just assume it like you are looking at the monitor through a mirror while typing English in the textarea.

        The solutions dir and style.direction just fulfills the first need listed above, but not the second one.

        So for the second one, you would need to find the position of the cursor (caret position). And using focus(caret), move the cursor to caretPosition-1 position every time you type in something (onkeypress). This won't be very easy though.

        PS: Google for "Urdu editor JavaScript", you may find something useful.

        Comment

        • farukcse
          New Member
          • Nov 2007
          • 52

          #19
          Dear Sir,
          Thanks to all.
          can you tell me how to execute key sequenec combinition using javascript i.e when i will click a buttton it will execute the key code for ALT and SHIFT key ?
          please try to write to me.

          Regards,
          Faruk Chowdhury

          Originally posted by hsriat
          No, actually the Arabic languages are written from right to left like this
          ...E...D...C... B...A
          <-- <-- <--

          (of course they don't call it ABCD..)

          So what he (OP) exactly wants is.
          1. Text should be right aligned
          2. When a letter is typed, the cursor should come in the left of the recently typed letter, instead of right side of the letter.

          Just assume it like you are looking at the monitor through a mirror while typing English in the textarea.

          The solutions dir and style.direction just fulfills the first need listed above, but not the second one.

          So for the second one, you would need to find the position of the cursor (caret position). And using focus(caret), move the cursor to caretPosition-1 position every time you type in something (onkeypress). This won't be very easy though.

          PS: Google for "Urdu editor JavaScript", you may find something useful.

          Comment

          • hsriat
            Recognized Expert Top Contributor
            • Jan 2008
            • 1653

            #20
            Originally posted by farukcse
            Dear Sir,
            Thanks to all.
            can you tell me how to execute key sequenec combinition using javascript i.e when i will click a buttton it will execute the key code for ALT and SHIFT key ?
            please try to write to me.

            Regards,
            Faruk Chowdhury
            Believe me, that's not going to work. ALT SHIFT is just a language setting on your machine but not general.

            And you are not even telling what is the problem with the solutions we provided. How long can we keep on doing guess work?

            Comment

            • farukcse
              New Member
              • Nov 2007
              • 52

              #21
              Dear Sir,
              According the previous solutions it just changes the direction from left to right .
              i think for my prblem i need to know how to execute key code sequence by javascript.
              please if you can try to reply to me.

              Thanks in advance .

              Regards,
              Faruk Chowdhury.

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #22
                You could try manually firing events, though I don't know if it would work. Have a read.

                Comment

                Working...