Custom footer on different pages | XM Community
Skip to main content
Solved

Custom footer on different pages


Forum|alt.badge.img+10
  • Level 2 ●●
  • 34 replies
Is it possible to hide some lines of text appearing in a survey footer for the first 3 pages of the survey only?

Best answer by TomG

@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> ```
View original

13 replies

  • 0 replies
  • August 10, 2018
Hello @Nadaly , Add the following line in first three pages of your survey. jQuery('#id of your text').hide();

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • Answer
  • August 10, 2018
@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> ```

  • 1 reply
  • October 1, 2018
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.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • October 1, 2018
@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.

  • 1 reply
  • January 31, 2019
@TomG where would the first <div> code go? In the footer? Or in a question?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • January 31, 2019
> @JC123 said: > > @TomG > where would the first `<div>` code go? In the footer? Or in a question? In the footer.

  • 3 replies
  • March 17, 2020
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!

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • March 17, 2020
@TheresaA, I could be a timing issue. Try changing addOnload to addOnReady.

  • 3 replies
  • March 18, 2020
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!

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • March 18, 2020
> @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(); }); ```

  • 3 replies
  • March 18, 2020
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> ~~~

Forum|alt.badge.img+1
  • 5 replies
  • April 19, 2024

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