Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Remove Hard Returns

Status
Not open for further replies.

stritec

Programmer
Oct 23, 2000
9
0
0
US
I have a memo field that gets written to a Database. My JSP page does a getString("memofield") and it's pulling the memo field into a variable. Lets call that variable foo so

Code:
String foo = myresultset.getString("memofield");

This is working fine.

Now I have some JavaScript that's using the foo string.

However, I get all kinds of crazy errors becuase my JavaScript won't execpt the string if it has returns in it.

Example. in the Database
row 1 memofield has:
Code:
hello how are you?
that's fine.
now row 2 memofield has:
Code:
hello
  how
     are
         you?
and that will now work. So I'm not sure what the easiest way to solve my problem would be. I think it would just be easier to extract all the returns and just set my variable foo equal to hello how are you?

Any ideas, comments, or suggestions would be greatly appreciated

Thanks,

Curt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top