473,221 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Textarea Inside of a textarea

I am writing a small database utility to catalog all of my favorite
ASM/JS/VBS... functions and scripts on an asp page. Everything is going
smoothly except for one thing that I can't quite seem to think my way
around.

I am using a <textarea> to display the code but some of my scripts have
<textarea> tags in them and when the </textarea> tag is entered, it
closes my <textarea> and the rest of the code ends up outside of the
textarea.

Example: (the code after the middle </textarea> show up outside of the
textarea box)

<textarea>
code...code...code...
code...<textarea></textarea>code...
code...code...code...
</textarea>

Anyone Got any Ideas? The page/code that is giving me a headache is
here...
http://www.wperry.net/projects/codelib/detail.asp?id=19

Feb 4 '06 #1
6 5939
<textarea>
<%=Server.HTMLEncode(varMyContent)%>
</textarea>

Anthony.
Feb 4 '06 #2
<wp*****@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am writing a small database utility to catalog all of my favorite
ASM/JS/VBS... functions and scripts on an asp page. Everything is going
smoothly except for one thing that I can't quite seem to think my way
around.

I am using a <textarea> to display the code but some of my scripts have
<textarea> tags in them and when the </textarea> tag is entered, it
closes my <textarea> and the rest of the code ends up outside of the
textarea.

Example: (the code after the middle </textarea> show up outside of the
textarea box)

<textarea>
code...code...code...
code...<textarea></textarea>code...
code...code...code...
</textarea>

Anyone Got any Ideas? The page/code that is giving me a headache is
here...
http://www.wperry.net/projects/codelib/detail.asp?id=19


Dim s
s = "code...code...code..." & vbCrLf
s = s & "code...<textarea></textarea>code..." & vbCrLf
s = s & "code...code...code..." & vbCrLf
s = Replace(s,"<","&lt;")
s = Replace(s,">","&gt;")
<textarea><%=s%></textarea>
Feb 4 '06 #3

Anthony Jones wrote:
<textarea>
<%=Server.HTMLEncode(varMyContent)%>
</textarea>

Anthony.


This is essentilaly what I am doing now. The problem is that when
varMyContent contains <textarea></textarea> the </textarea> closes the
textarea tag that is supposed to contain the code.

Feb 4 '06 #4

McKirahan wrote:
<wp*****@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am writing a small database utility to catalog all of my favorite
ASM/JS/VBS... functions and scripts on an asp page. Everything is going
smoothly except for one thing that I can't quite seem to think my way
around.

I am using a <textarea> to display the code but some of my scripts have
<textarea> tags in them and when the </textarea> tag is entered, it
closes my <textarea> and the rest of the code ends up outside of the
textarea.

Example: (the code after the middle </textarea> show up outside of the
textarea box)

<textarea>
code...code...code...
code...<textarea></textarea>code...
code...code...code...
</textarea>

Anyone Got any Ideas? The page/code that is giving me a headache is
here...
http://www.wperry.net/projects/codelib/detail.asp?id=19


Dim s
s = "code...code...code..." & vbCrLf
s = s & "code...<textarea></textarea>code..." & vbCrLf
s = s & "code...code...code..." & vbCrLf
s = Replace(s,"<","&lt;")
s = Replace(s,">","&gt;")
<textarea><%=s%></textarea>


I though for sure that I would end up with the escape codes displayed
in the text area if I did it tis way but I read your post and decided
to try it. It works like a charm.

Thanks a lot.

Feb 4 '06 #5
Then you are doing something wrong.

<%
var = "<textarea> some stuff</textarea>"
%>
<form method=post action="">
<textarea name="" rows="20" cols="40"><%=server.htmlencode(var)%></textarea>
</form>

Bob Lehmann

"Will" <wp*****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...

Anthony Jones wrote:
<textarea>
<%=Server.HTMLEncode(varMyContent)%>
</textarea>

Anthony.


This is essentilaly what I am doing now. The problem is that when
varMyContent contains <textarea></textarea> the </textarea> closes the
textarea tag that is supposed to contain the code.

Feb 5 '06 #6
Will,

Seriously, why are you not using Server.HTMLEncode ???

What happens if you code contains &? That also needs escaping.

Anthony.

Feb 5 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hal Halloway | last post by:
I want a text editor inside a form's textarea, So I would see html markup and html entities - just like a text editor. I also would want to be able to edit it all just like a text editor - this...
4
by: Simon | last post by:
I have another question.. Let's take a textarea with the parameter: "rows=4" (<textarea rows=4 onkeydown="CheckScrollbar()"> ) If you start typing the scrollbar at the right is not active. Only...
0
by: J. Muenchbourg | last post by:
How do I specify inside a datagrid that does edits/updates, that a certain field should display its contents in TEXTAREA html objects, not text box controls. See tag in boundcolumn/datagrid...
1
by: Hans | last post by:
How do I capture the keycode inside a <textarea> in NN6+ and IE5.5+? I don't want to add add document.keyPress function because I only want this to occure when a specific textarea is selected and...
1
by: tranky | last post by:
Hola boys, i've a question for you! It's possible to highlight some text inside a textarea? (not all text, but a portion!) For example, i've this text inside a textarea. INSERISCI TESTO i...
2
by: mattrapoport | last post by:
Hello, I am have a div and inside of that div I have a textarea. There is nothing else in the div. The text in the textarea will come from a database so it needs to be able to wrap and grow as...
0
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be...
0
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be followed...
3
AMT India
by: AMT India | last post by:
Hi, I am using FckEditor.It works well.But the problem is that when I insert a "textarea" using source edit,the FCK editor not showing the elements after the textarea.Is this because this...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.