Provide Bullets for Survey Participants When Typing Comments | XM Community
Question

Provide Bullets for Survey Participants When Typing Comments

  • 23 November 2020
  • 1 reply
  • 4 views

Badge +3

Greetings!
I have a client that has a survey made up mainly of open comments. They would like to give participants the option to format their comments with bullets, like a rich text editor for the comments. Is that possible? If so, how is it set-up?
Thanks!!
Alicia


1 reply

Userlevel 7
Badge +27

Hi there, if you still need, something like this can be put in place by adding the below to the OnReady section of a Text Entry question's JavaScript. It adds a line break, bullet, and a space each time the Enter key is pressed. I adapted it from here
jQuery("#"+this.questionId+" .InputText").val('• ');
jQuery("#"+this.questionId+" .InputText").on('keydown',function(e){
  var t = jQuery(this);
  switch(e.which){
  case 13:
    t.val(t.val()+'\\n• ');
    return false;
  } 
});
LinebreakBullets.png

Leave a Reply