A carriage return in a text area token will break Javascript

Posted by Rollbase User on 20-May-2010 14:44

Example: Text area field "text_area_fld" contains: This is line one This is line two When I use the token in a Javascript function, the carriage return is breaking the code: var astring = "{!text_area_fld}"; Resolves to: var astring = "This is line one This is line two"; ...which produces a syntax error because there's a carriage return.. I need it to resolve to something like this: var astring = "This is line one This is line two"; Any suggestions on how I could handle a case like this?

All Replies

Posted by Admin on 20-May-2010 15:58

This should be handled by template parser, I'll see what I can do.

Posted by Admin on 20-May-2010 16:08

This is actually work fine on server side. So I assume you're talking about client-side code.

You can try to use AJAX API to retrieve TextArea's value rather than use template token.

Posted by Admin on 21-May-2010 07:23

The AJAX API worked: rbf_getFields().

Thanks.

This thread is closed