Custom footer on different pages | XM Community
Skip to main content
Is it possible to hide some lines of text appearing in a survey footer for the first 3 pages of the survey only?
Hello @Nadaly ,



Add the following line in first three pages of your survey.

jQuery('#id of your text').hide();
@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.
@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?
> @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!
@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!
> @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>

~~~

Hi there,

 

Following up here a lot later as this thread has proven somewhat useful to me! I am running into an issue though and I am not sure why. It may be because something has changed in the 4 years since this was posted.

 

I can get the removed footer to work perfectly within the Look and Feel section, but as soon as I move back to the Edit Block section and preview my survey it stops working! I navigate back to the Look and Feel, general settings, HTML source within the footer text and the last line of code (the <script>) has always disappeared.

 

What could be causing this issue? @TomG I am wondering if you could help me out please?

 

Thank you for you time.


Leave a Reply