473,779 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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...c ode...
code...<textare a></textarea>code.. .
code...code...c ode...
</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 5991
<textarea>
<%=Server.HTMLE ncode(varMyCont ent)%>
</textarea>

Anthony.
Feb 4 '06 #2
<wp*****@gmail. com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.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...c ode...
code...<textare a></textarea>code.. .
code...code...c ode...
</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...<textar ea></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.HTMLE ncode(varMyCont ent)%>
</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.goo glegroups.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...c ode...
code...<textare a></textarea>code.. .
code...code...c ode...
</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...<textar ea></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"><%=se rver.htmlencode (var)%></textarea>
</form>

Bob Lehmann

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

Anthony Jones wrote:
<textarea>
<%=Server.HTMLE ncode(varMyCont ent)%>
</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.HTMLEnco de ???

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
9363
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 is done in PHPMyadmin for example...is there an easy way to do this? In a way i'm asking the browser to suspend rendering markup.
4
5277
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 when you exceed the four lines (rows=4) the scrollbar becomes active. That moment..the moment the scrollbar becomes active..can javascript recognize/capture this moment? Thanks, Simon
0
1053
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 control: <asp:BoundColumn DataField="sampleletext" HeaderText="Sample Text"> </asp:BoundColumn> ...and if I can put a textarea object in a datagrid, will I use the
1
18587
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 not fire for every keypress in the entire document. <textarea onkeypress="captureKeys();".... but I cannot get a reference to the current event so i can ask for the keyCode. In IE I can check the event.keyCode inside my function captureKeys...
1
7485
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 want to highlight only "INSERISCI TESTO". It, must be an universal function, so i can use it also in other cases, for example when tag are and .
2
19292
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 necessary. I've tried a whole bunch of permutations and I'm not having any luck. Any help would be greatly appreciated. Here's the code: HTML: <div class='desc'><textarea class='desc_text'>blah blah blah blah blah blah blah blah blah blah...
0
3511
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 when putting xml between the <textarea></textarea> tags. The textarea and the submit buttons are located inside <form> tags. When a button is pressed it calls a jsp page to do the processing needed. For some xml content it works nicely....for...
0
6437
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 when putting xml between the <textarea></textarea> tags. The textarea and the submit buttons are located inside <form> tags. When a button is pressed it calls a jsp page to do the processing needed. For some xml content it works nicely....for others i...
3
5411
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 textarea is inside the main fckeditor textarea which replace the content.So the textarea inside closes,the main textarea get closed.Is there any method to use text area in FCKEditor? Thanks & Regards, AMT
0
10306
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.