Preserving whitespace characters

29 views
Skip to first unread message

Johan Vosloo

unread,
Aug 3, 2012, 11:08:55 AM8/3/12
to pla...@googlegroups.com
Hi guys

I'm using the Play Crud module to edit a db table directly.
One of the db fields is used to store text field row separators, typically CRLF.

How can I preserve the white space characters (CRLF) during form submission, so the field is updated and read correctly?
If I override the crud form field an turn it into a textarea, I can for example hit the enter key in the textarea - saving the form persists a CRLF to the DB.
When I edit the record again though (even with .raw()) - it loses the CRLF.

Johan Vosloo

unread,
Oct 28, 2012, 7:13:49 PM10/28/12
to pla...@googlegroups.com
For reference - solved this by overriding the 'form' and 'save' functions in the the particular model class's CRUD controller.
Formatted the \r\n chars to 'CRLF' when displaying the form, and then back to \r\n when saving the form
Reply all
Reply to author
Forward
0 new messages