tab escape not shown in textarea

S

soup_or_power

Hi
My string contains "\t" for tabs. When the string is seen in a texarea
I only see "t" without the escape. This is not what I expect. I expect
either a blank or escaped-t. Any help is appreciated.


Thanks for your help.
 
R

Randy Webb

(e-mail address removed) said the following on 8/12/2005 5:13 PM:
Hi
My string contains "\t" for tabs.

So far so good.
When the string is seen in a texarea I only see "t" without
the escape. This is not what I expect. I expect either a blank
or escaped-t. Any help is appreciated.

In what browser does it show you just a t? And, what do you want, the
tab or the code to show?

window.onload=testIt;

function testIt(){
document.myForm.myTextArea.value ="This is a\t test of this script";
}

<form name="myForm">
<textarea name="myTextArea" rows="30" cols="30"></textarea>
</form>

Displays the tab in IE6 XP SP2, Firefox and Opera 8.
 
S

soup_or_power

Randy said:
(e-mail address removed) said the following on 8/12/2005 5:13 PM:


So far so good.


In what browser does it show you just a t? And, what do you want, the
tab or the code to show?

window.onload=testIt;

function testIt(){
document.myForm.myTextArea.value ="This is a\t test of this script";
}

<form name="myForm">
<textarea name="myTextArea" rows="30" cols="30"></textarea>
</form>

Displays the tab in IE6 XP SP2, Firefox and Opera 8.


I'm testing in FireFox and IE6. The string sent to standard error
(on unix) has \t separated fields. But in the textarea it only
shows "t" without the escape. I am sorry this is not a javascript
related. May be I should take this to alt.html.

Many thanks.
 
R

Randy Webb

(e-mail address removed) said the following on 8/13/2005 8:18 AM:
I'm testing in FireFox and IE6. The string sent to standard error
(on unix) has \t separated fields. But in the textarea it only
shows "t" without the escape. I am sorry this is not a javascript
related. May be I should take this to alt.html.

Many thanks.

If I am understanding you (I don't use unix a lot), it has a standard
error mechanism that uses \t seperated fields and you are wanting to
display that error message in a textarea? How you would do that is
dependent on how the error message is generated and given to the browser.

It could possibly need nothing more than a replace of \ with \\ before
being sent to the browser. Or, changing it to an entity before being
sent to the browser. But that would need an engine that does not treat \
as a special character.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top