White spaces in AW.HTML.TEXTAREA content

I'm still evaluating and making good progress.

I've now encountered the following problem and need help:

1. I am using AW.HTML.TEXTAREA in one of my interfaces as follows:

var comment = new AW.HTML.TEXTAREA;

2. I fetch theCommentFromMyDatabase from my MySQL database and insert it into the comment control using:

comment.setContent("html", theCommentFromMyDatabase)

When the theCommentFromMyDatabase does not contain any white spaces I have no problems - everything works fine.

However, when theCommentFromMyDatabase contains white spaces (type: \r\n - carriage returns and line feeds) my module fails completely.

I've searched all over the documentation and have tried various work-arounds but all in vain.

Can anyone please give me a hint as to how I can solve this problem ?? It is very important for my evaluation since I need modifiable TEXTAREAs in my interfaces which are stored in my database.


George Leonard
October 4,
If you create javascript code dynamically by the server-side script - make sure you don't break javascript syntax. String constants cannot span multiple rows - you have to escape line breaks and other special characters.

line break -> \n
quote -> \"
slash -> \\
Alex (ActiveWidgets)
October 5,
Some examples -

var multiLineString = "first line \n second line";
var quoteInsideString = "quote \" inside";
var slashInsideString = "slash \\ inside";
Alex (ActiveWidgets)
October 5,
Thanks Alex. I'm a blooper when it comes to JavaScript.

By the way : AW is looking very good for my evaluation. You've done an incredible job. Only wish I knew more JavaScript - I'm at ground 0.

At any rate this should be a good plug for your product since if I can use AW in my projects (I do PHP / MySQL) - anyone can. A novice to AW will need a little persistence in going through the documentation but with a little effort anyone with a little programming experience can really get good results. Plus, I feel that your price of $400 is a bargain. Also, I like your community - seems very open. Nice.

George Leonard
October 7,

This topic is archived.

See also:

Back to support forum