I have two surveys: Survey 1 and Survey 2. In survey 1, I have a “Text Entry” field where the participants can enter multiple lines and it will be displayed in Survey 2. I used JS and Query String to pass the data from survey 1 to survey 2.
Piped text value of the text entry field in survey 1: ${q://QID142/ChoiceTextEntryValue}
Imbedded data in survey 2: MM_Text
My JS code is given below. It is added to the last question of Survey 1.
jQuery("#NextButton").on('click', function() {
var MM_Val= "${q://QID141/SelectedChoicesRecode}";
var MM_Text= "${q://QID142/ChoiceTextEntryValue}";
var fullURL = 'Survey 2 link?'
+ 'MM_Val=' + MM_Val
+ '&MM_Text=' + MM_Text;
var link1 = window.open(fullURL, '_parent');
});
The code works fine and trigger survey 2 at the end of survey 1, as long as a participant do not use ENTER while writing in the Text Entry field of Survey 1. It accepts alpha numeric values, emojis, SPACE everything, except for ENTER. If someone writes a paragraph using ENTER instead of SPACE, the survey ends at the THANK YOU page of survey 1 and does not trigger Survey 2. How do I solve this issue?