By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,608 Members | 1,925 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,608 IT Pros & Developers. It's quick & easy.

tab escape not shown in textarea

P: n/a
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.

Aug 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
so***********@yahoo.com 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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 12 '05 #2

P: n/a

Randy Webb wrote:
so***********@yahoo.com 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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly

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.

Aug 13 '05 #3

P: n/a
so***********@yahoo.com said the following on 8/13/2005 8:18 AM:
Randy Webb wrote:
so***********@yahoo.com 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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly


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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.