Hello,
I am trying to auto fill a text box in a question using Javascript. I want it to appear in a sequential format but I cannot seem to add a line break in the text I want to add. I tried using '\\n', '<'br'>' and '<'br/' >' but nothing is working. How can I accomplish this?
Thanks
Page 1 / 1
Make sure your text input question is the Essay type so that it is a `<textarea>`. `<input>` doesn't support line breaks, but `<textarea>` does. Then use \\n:
```
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .InputText").val("line1\\nline2");
});
```
```
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .InputText").val("line1\\nline2");
});
```
@TomG thank you for your response. I would never have guessed the question type would be the issue.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.