PDA

View Full Version : Multi-line strings


cwcto
11-23-2002, 03:15 AM
Trying to manipulate a form in another frame with JavaScript. Problem is the following code is dynamically generated via asp from a database with carriage returns (that need to remain since I'm trying to put this string into a textarea.) I'm pulling the value from a database and writing out this line with the result. I get an 'unterminated string' error when I include the carriage returns but not if I strip them out first (need to have them in.)

parent.frames[0].frmAddArticleForm.txtArticleText.value = '

The Associated Press


Susquehanna 80, Gallaudet 67';

Any ideas?

Thanks!

joh6nn
11-23-2002, 04:53 AM
replace carriage returns with \n

cwcto
11-23-2002, 04:57 PM
OK, I'm an idiot. I thought I tried that but it turns out I used /n instead of \n. Works now.

Thanks joh6nn!