Custom footer on different pages | XM Community
Solved

Custom footer on different pages


Userlevel 3
Badge +6
Is it possible to hide some lines of text appearing in a survey footer for the first 3 pages of the survey only?
icon

Best answer by TomG 11 August 2018, 00:23

View original

12 replies

Hello @Nadaly ,

Add the following line in first three pages of your survey.
jQuery('#id of your text').hide();
Userlevel 7
Badge +27
@Nadaly,

Put the footer text you want to hide inside a `<div>` with an id:
```
<div id="hideThis">
Text to be hidden
</div>
```
Also, add a script to your footer that will hide the `<div>` if a flag is present on the page:
```
<script>
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#hideFooterText").length > 0) jQuery("#hideThis").hide();
});
</script>
```
Then, when you want to hide the footer text on the page, add this to the question text of one of the questions on the page:
```
<span id="hideFooterText"></span>
```
If I just want to see the footer for some of my questions and suppress it for others, is this the same process? I am having trouble with the steps outlined above. I am brand new to Qualtrics and don't know JS, so I would love very specific, explicit direction if anyone has time.
Userlevel 7
Badge +27
@LindseyC,

Yes, the same process will work on any page (footers are associate with a page, not a question).

I can't really get much more specific on the instructions. Make sure are in html or source (<>) mode when you edit your question text and footer.
I would like to request, if someone can provide me the screenshot, of each step of code to be placed.
I've tried the above-said steps, nothing worked out.
@TomG
where would the first <div> code go? In the footer? Or in a question?
Userlevel 7
Badge +27
> @JC123 said:
>
> @TomG
> where would the first `<div>` code go? In the footer? Or in a question?

In the footer.
Hello. I am having trouble with this as well. I put the text I wanted to hide within the `<div>` code @TomG suggested and added the script to the footer. I then put the `<span>` code into the HTML of a question on the page. But the footer is still showing up.

Here is my footer (in HTML editor view):

~~~~
<div id="hideThis" style="text-align: center;">Footer text</div>
<script>
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#hideFooterText").length > 0) jQuery("#hideThis").hide();
});
</script>
~~~~

Here is how it is embedded in the question (in HTML editor view):

~~~~
Question wording<span id="hideFooterText"></span>
~~~~

But the footer is still showing up on the page with that question. Any suggestions?

Thank you in advance!
Userlevel 7
Badge +27
@TheresaA,

I could be a timing issue. Try changing addOnload to addOnReady.
Thanks @TomG , but it's still not working (even on subsequent pages where it may have had a chance to load, if that is the issue). Any other strategies?

If this doesn't work, I can separate and link two separate surveys. I'd just prefer not to do that if I can avoid it because I already have linked surveys in this project.

Thanks again!
Userlevel 7
Badge +27
> @TheresaA said:
> Thanks @TomG , but it's still not working (even on subsequent pages where it may have had a chance to load, if that is the issue). Any other strategies?
>
> If this doesn't work, I can separate and link two separate surveys. I'd just prefer not to do that if I can avoid it because I already have linked surveys in this project.
>
> Thanks again!

Upon closer inspection, there is a syntax error. It is missing the if:
```
Qualtrics.SurveyEngine.addOnload(function() {
if(jQuery("#hideFooterText").length > 0) jQuery("#hideThis").hide();
});
```
Thank you, @TomG! It worked! For the record (in case others are looking at this thread), I put the following in my footer:

~~~
<div id="hideThis" style="text-align: center;">Footer text</div>
<script>
Qualtrics.SurveyEngine.addOnReady(function() {
if(jQuery("#hideFooterText").length > 0) jQuery("#hideThis").hide();
});
</script>
~~~

And then this in a question on each page:

~~~
Question wording<span id="hideFooterText"></span>
~~~

Leave a Reply