"Travis Pupkin" <> wrote in message
news: t...
> Hi,
>
> I'm putting together a site to allow someone to add content to a DB
> through a text area form, and then display it on the web. Pretty basic.
>
> The problem I'm having is that they need to add snippets of javascript,
> but by the time its displayed on the page, there have been extra
> linebreaks added, breaking the javascript code.
>
> Replace(string, vbCrLf,"") won't work because that removes all
> linebreaks. Is there a way to preserve the original linebreaks as
> submitted to the DB in the first place?
>
> Thanks.
one way - set the "wrap" attribute of the textarea to "hard" and it
sends the data exactly as it appears in the textarea.
<textarea wrap="hard" name="codeStuff">
--- or--- tell user to enter semicolons after every javascript command
** this will work**
document.write("hello"); var myVar = 10; document.write(myVar)
**this will not work***
document.write("hello") var myVar=10 document.write(myVar) //'**(no
semicolons)
**this will work** (should include some line breaks)****
document.write(
"hello"
);
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.807 / Virus Database: 549 - Release Date: 12/7/2004