Arabic text box

2019-01-27 23:39发布

问题:

I have developed a web site: Some fields are entered in English while others are entered in Arabic language.

Now i wanna simplify the input operation for the user and want Arabic textbox as a DLL.

I have one but it works only with IE - not with firefox or google chrome ..

thanks so much..

How to enforce the user to write in Arabic? I mean moving the cursor directly without (ALT + SHIFT) keys every time when trying to change the language... If there is any way, property , DLL or what ever to do that...

回答1:

You could use this mature javascript library that works fine on firefox and IE, just add an attribute like lang='fa' or lang ='en' to your textbox and you're done, sure you can tailor it for your usage.

it's in persian and you can translate it with google to read the page.

I've done the adding attribute in client code and it's like this

 <script type="text/javascript">
                $().ready(function () {
                    $("input,textarea").each(function () {
                        $(this).attr("lang", "fa");
                    });
                });
  </script>


回答2:

Why you don't use direction and alignment properties of standard text box instead of an alternative one?