Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Rich text editor in long text answer

  • lordzoster
  • lordzoster's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #105015 by lordzoster
Rich text editor in long text answer was created by lordzoster
Hallo how could I provider the user with a rich text editor (like TinyMCE) for long text answers?
My aim is that the user can answer entering graphically formatted text (bullets, lists, italic and bold).
Thanks in advance
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 1 month ago - 10 years 1 month ago #105052 by tpartner
Replied by tpartner on topic Rich text editor in long text answer
Well, LimeSurvey uses CKEditor but, in my opinion, that is bloated and a pain to set up.

The easiest solution would be to use the CDN version of TinyMCE - www.tinymce.com/index.php .

So, simply adding something like this to startpage.pstpl after the {TEMPLATEJS} tag should do the trick.

Code:
<script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<script>
  tinymce.init({
    plugins: 'link, code',
    menubar : false,
    toolbar1: 'undo redo | formatselect fontselect fontsizeselect | link | code',
    toolbar2: 'bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote', 
    selector:'textarea'
  });
</script>



.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 1 month ago by tpartner.
The following user(s) said Thank You: DenisChenu, stevelegare, lordzoster
The topic has been locked.
  • lordzoster
  • lordzoster's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #105059 by lordzoster
Replied by lordzoster on topic Rich text editor in long text answer
Many many many thanks!
The topic has been locked.
More
9 years 1 month ago #117312 by marvin06
Replied by marvin06 on topic Rich text editor in long text answer
Hi

I also wanted to implement this. Basically the WYSIWYG Editor is displayed, but the Long text and Huge text questions only store plain text. So in the print answer page again only plain text is visible.

Do you have a fix for this?

Kind regards
Thomas
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #117316 by tpartner
Replied by tpartner on topic Rich text editor in long text answer
I think that may be a bug in the print-answers function. The data is being stored as HTML.


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 1 month ago #117318 by marvin06
Replied by marvin06 on topic Rich text editor in long text answer
Yes you are right. in the export html is exported too. But in the printanswers page the answers are displayed without any html.
This is valid for any template, also for the ready made ones. I suppose that there is an bug in the printanswers control.

I would like to look into the control for the printanswers. Do you know where this is stored?

Kind regards, Thomas
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose