Dear Sir,
Is there any way or property for chaning the text diriction from right to left automatically when i want to take arabic text as a input . now this possible by ALT+SHIFT pressing . but i want to do it automatically by using javscript or style sheet .
Please try to reply to me.
Regards,
Faruk Chowdhury
21 16830
Dear Sir,
Is there any way or property for chaning the text diriction from right to left automatically when i want to take arabic text as a input . now this possible by ALT+SHIFT pressing . but i want to do it automatically by using javscript or style sheet .
Please try to reply to me.
Regards,
Faruk Chowdhury
See the text direction property if its of any use.
If not then you may have a look at dir and lang attribute of textarea tag.
Place a language selector radio button and call the function to change the properties onclick event of the radio button.
PS. Ask such questions in JavaScript forum.
Atli 5,058
Expert 4TB
I have moved this thread over to the Javascript Forums.
Please try to post you questions in the appropriate forums.
Thanks.
Dear Sir,
When I press Alt+Shift in a text control, the cursor turns Right-To-Left.
I want it without pressing Alt+Shift, I want to when I click a text control
the cursor automatically turn to Right-To-Left.
please try to reply.
Thanks in advance.
Regards,
Faruk Chowdhury
Dear Sir,
Thank you for your quick reply.
When I press Alt+Shift in a text control, the cursor turns Right-To-Left.
I want it without pressing Alt+Shift, I want to when I click a text control
the cursor automatically turn to Right-To-Left.
i sent this question to javascript forum also.
According to your previous reply the direction goes from left to right but i need as when I click a text control the cursor automatically turn to Right-To-Left.
so if you can please help me.
thanks in advance.
Regards,
Faruk Chowdhury
See the text direction property if its of any use.
If not then you may have a look at dir and lang attribute of textarea tag.
Place a language selector radio button and call the function to change the properties onclick event of the radio button.
PS. Ask such questions in JavaScript forum.
According to your previous reply the direction goes from left to right but i need as when I click a text control the cursor automatically turn to Right-To-Left.
so if you can please help me.
thanks in advance.
Regards,
Faruk Chowdhury
- function urduWriter(onOrOff) {
-
document.getElementById('ta').style.direction =onOrOff ? 'rtl' : 'ltr';
-
//document.getElementById('ta').dir = onOrOff ? 'rtl' : 'ltr';
-
}
Call this function to change the direction from right to left as urduWriter(true).
To restore the direction, call urduWriter(false)
Merged threads. Thread had already been moved to this forum.
Moderator.
I am really unsure why this link did not solve the problem: http://www.w3schools.com/htmldom/pro..._direction.asp
I guess he's not aware of how to change this property with JavaScript.
Or perhaps the w3school's server was down when he clicked this link.
But its working, I just tested... -
<script type="text/javascript">function urduWriter(onOrOff) {
-
document.getElementById('ta').style.direction =onOrOff ? 'rtl' : 'ltr';
-
}
-
</script>
-
<textarea id="ta"></textarea><br>
-
<button onclick="urduWriter(true);">On</button>
-
<button onclick="urduWriter(false);">Off</button>
I guess he's not aware of how to change this property with JavaScript.
Or perhaps the w3school's server was down when he clicked this link.
Why not just build your html pages with it set already? The OP said js/CSS but it might have been because they were unaware that it can be done with a regular html attribute.
Why not just build your html pages with it set already? The OP said js/CSS but it might have been because they were unaware that it can be done with a regular html attribute.
good point...
but I have seen such pages.. they show radio button by which you can select the language you want to type in... I just guessed it might be similar caase...
so this will work ...[html]<textarea dir="rtl"></textarea>[/html]
There are a number things I have discovered here. Text direction seems to automatically inherit from it's parent object: -
<html>
-
<head>
-
<title>Direction Test</title>
-
<script type="text/javascript">
-
function changeTextDirection()
-
{
-
var curdir=document.getElementById("mybody").style.direction;
-
if(curdir=="ltr")
-
{
-
document.getElementById("mybody").style.direction="rtl";
-
}
-
else
-
{
-
document.getElementById("mybody").style.direction="ltr";
-
}
-
}
-
</script>
-
-
</head>
-
<body id="mybody" dir="rtl">
-
<span >fred jones</span><br/>
-
<div > bibbidy bop</div><br/>
-
<input type="text" value="some text" /><br/>
-
<textarea >This is some text</textarea><br/>
-
<input type="button" dir="inherit" onclick="changeTextDirection();" value="Swap It"/>
-
</body>
-
</html>
-
There is also a css property: http://www.1keydata.com/css-tutorial/text.php#direction
So if you only want the inputboxes/textareas to switch, you can apply a special CSS tag to them and have them all start out with the right-to-left set.
Dear Sir,
Thank you for cooperation.
my problem is with the use of ALT+SHIFT in the input box to write arabic text. i want to do this automatically i.e when i click in the input box the ALT+ SHIFT task will be done by programatically .
According to your code the directiong is changing from left to right but still i have to use the ALT+SHIFT key for taking the arabic input.
So if you have any idea please write to me.
Thanks in advance .
Regards,
Faruk Chowdhury
There are a number things I have discovered here. Text direction seems to automatically inherit from it's parent object: -
<html>
-
<head>
-
<title>Direction Test</title>
-
<script type="text/javascript">
-
function changeTextDirection()
-
{
-
var curdir=document.getElementById("mybody").style.direction;
-
if(curdir=="ltr")
-
{
-
document.getElementById("mybody").style.direction="rtl";
-
}
-
else
-
{
-
document.getElementById("mybody").style.direction="ltr";
-
}
-
}
-
</script>
-
-
</head>
-
<body id="mybody" dir="rtl">
-
<span >fred jones</span><br/>
-
<div > bibbidy bop</div><br/>
-
<input type="text" value="some text" /><br/>
-
<textarea >This is some text</textarea><br/>
-
<input type="button" dir="inherit" onclick="changeTextDirection();" value="Swap It"/>
-
</body>
-
</html>
-
There is also a css property: http://www.1keydata.com/css-tutorial/text.php#direction
So if you only want the inputboxes/textareas to switch, you can apply a special CSS tag to them and have them all start out with the right-to-left set.
Ok, well alt+shift does nothing for me, so it must be some special language support feature on your system.
It does not have anything to do with the text direction it would seem so that was a red herring.
I am not sure how you would change the system local of a client machine through a webpage, maybe somebody else can help?
Dear Sir,
Thank you for cooperation.
my problem is with the use of ALT+SHIFT in the input box to write arabic text. i want to do this automatically i.e when i click in the input box the ALT+ SHIFT task will be done by programatically .
According to your code the directiong is changing from left to right but still i have to use the ALT+SHIFT key for taking the arabic input.
So if you have any idea please write to me.
Thanks in advance .
Regards,
Faruk Chowdhury
Did you try the post # 9?
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....
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.
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.
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
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.
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?
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.
You could try manually firing events, though I don't know if it would work. Have a read.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: suhaddad |
last post by:
I have an XML schema that I want to modify. I need to change the text
from English to Arabic, but I can't seem to be able to do so.
<LearningResourceData Type="Session - Tutorial and Workouts">...
|
by: Khan |
last post by:
Hi all,
I have a textbox 'remarks' in jsp which has some arabic text.
while pressing the submit button the arabic text is storing in java
string variable.
String rem = ...
|
by: jrs_14618 |
last post by:
Hello All,
This post is essentially a reply a previous post/thread
here on this mailing.database.myodbc group titled:
MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode
I was...
|
by: Santosh |
last post by:
dear all i want to change text direction of text box with in datagrid
control i am writting following code but it is not working.
public void SetUpClientScript(object sender,...
|
by: Sjef Janssen |
last post by:
Is it possible to have a box (div) which sets a background-color and which
contains (on the same line) text which is left aligned and text which is
right aligned. (as in a table: two td's left one...
|
by: pflynn |
last post by:
I need to center the text in a div within its natural width (ie the width of the longest line) and then place that div on the RH side of the window.
<div id="#ident">
<div id="#address">
...
|
by: RobinS |
last post by:
Is it possible to left-justify, center, or right-justify text on a panel
when drawing it using DrawString?
I looked at the StringAlignment class, but all it has is far, near, and
center.
...
|
by: hash4sp |
last post by:
Hello !
DBF file consists of a field i.e."districts" which holds data in Arabic language. DBF file is in ANSI format. How to convert this ANSI format so that it displays actual Arabic text on the...
|
by: sebouh181 |
last post by:
Hello everyone
I have an ASP.NET website with arabic interface.
When I type arabic text and at the end of the text I put a point, the point is displayed at the beginning of the text.
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |