Text entry box like a tweet | XM Community
Skip to main content
Hi, I would like to have participants complete a tweet that ends by #... Ideally I would like to have the same box as on Twitter when you enter a post, with just a #... static at the end of the post Alternatively I would like to have just a box with #... at the end Any ideas ?
Hello @Clin , Paste the following code in the js(onReady) of Text entry question jQuery("[id='QR~"+this.questionId+"']").keyup(function(){ var k=jQuery(this).val().replace(/#/g, ""); jQuery(this).val(k+"#"); }); The above code will append '#' at the end of user input
Hi @Shashi Thank you so much for your help. Is there a way I can have the #xxx appear at the end of a multiline text entry box, even before the participant starts typing? and it should stay while he/she is typing.
Hello @Clin , Paste the following code in the js(onReady) of Text entry question jQuery("[id='QR~"+this.questionId+"']").val("#xxx"); jQuery("[id='QR~"+this.questionId+"']").keyup(function(){ var k=jQuery(this).val().replace(/#xxx/g, ""); jQuery(this).val(k+"#xxx"); });
Thanks!