Hi,
Is there a way to place a question (actually, a fairly long block of text) below the next button for some pages only? Basically, we want to add a fairly long block of text that the respondents can read optionally if they want to, but we don't want them to have to scroll over that text if they don't want to to go to the next button.
I realize that the following javascript works, sort of:
jQuery("#Buttons").css({"text-align": "right",
"padding": "20px",
"margin-top":"-1000px"});
But we want to place the next button specifically above one "question," after making some space for it. This script requires that we set specific amount of space to adjust the location by on every page and, with blocks of text with different length, it would be impossible practically to figure out the amount of offsets by trial and error, it seems. I'm wondering if there is a way to make sure that the next button shows up just before the last question on that page regardless of how long the last question is.
Thanks!
h27kim
Why don't you include that in the footer in Look & Feel and enable the footer on page load where you want to show and hide where you don't want to show?
To hide:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
jQuery('#Footer').css('display','none');
});
You can enable the footer by including the code below on specific questions on the page you would like to show. Also, if the footer text differs on each page you can include it in a question and pipe that within an embedded data and pipe that embedded data in Footer.
To show:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
jQuery('#Footer').css('visibility','visible !important');
});
Hope it helps!
Or, you can just move your question below the Next button by adding this JS to the question to be moved:
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery("#Buttons").after(jQuery(this.questionContainer));
});
Deepak
Can't edit the Look and Feel: the survey has something like 25 pages, of which about 20 pages need the next buttons moved, and we are doing it because the bottom question on these pages are "optional," so to speak. Plus, we want to add actual "questions" (as text) since we want the bottom question to be full sized (with some html added as well, distinct for each page).
TomG
I did not know about that. I'll try that out. Thanks!
h27kim
All of it can be managed via footer as well. But since the number of pages and questions is large I would not recommend it. You can go with TomG's code. that's the best approach for you.
TomG
The script does not seem to be doing anything, at least not in preview mode. I wondered if that's because it should fire on load, so tried it again after editing the code to .addOnLoad instead, but that doesn't seem to work either....
https://community.qualtrics.com/XMcommunity/discussion/comment/51795#Comment_51795It works for me and addOnReady is correct. If anything, it has to happen later rather than earlier (addOnload). Try setting Page Transition to None (Look & Feel -> Motion).
@TomG
Just to make sure, the script needs to be added to addOnLoad on the "bottom" question, right? Suppose, for example, the survey has 3 questions on a given page, in following order:
Q1
Q2
next button
Q3
The script needs to be added to Q3, with addOnReady replaced with addOnLoad (at the appropriate place), right?
TomG
Got it to work! Silly typo on my part.
Yes, add the script to Q3, but DO NOT change addOnReady. As I said previously, if it doesn't work, set Page Transition to None.
BTW, addOnLoad isn't valid function name, it is addOnload.
TomG
That was the typo, even worse since Qualtrics now includes the templates in their Javascript editor. Thanks so much! :)
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.