Specifying a Text Anchor | XM Community
Skip to main content
Solved

Specifying a Text Anchor

  • November 17, 2018
  • 10 replies
  • 1021 views

shphill
I want to add some additional descriptive text within a question to link to from a question statement. I found the following in the user documentation: "Text anchors allow you to link to content in the same question. For example, if you have a long disclaimer with various sections in your survey, you can use a text anchor to link to the top of each section—ultimately making it easier for your participants to navigate. Text anchors must be specified in the question in order to use this option." However, It does not explain how to specify a text anchor.

Best answer by TomG

You create an html text anchor (aka bookmark) by giving an element an id: ``` <div id="MyBookmark">Bookmark content</div> ``` You can then create a link to the bookmark like this: ``` <a href="#MyBookmark">Jump to bookmark</a> ```

10 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • November 18, 2018
You create an html text anchor (aka bookmark) by giving an element an id: ``` <div id="MyBookmark">Bookmark content</div> ``` You can then create a link to the bookmark like this: ``` <a href="#MyBookmark">Jump to bookmark</a> ```

shphill
  • Author
  • November 18, 2018
Tom, Does the bookmark and link need to be contained within the same question?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • November 18, 2018
No, just on the same page.

shphill
  • Author
  • November 18, 2018
When I click on the link in Preview Mode, it opens a blank page. It does not jump to the bookmark.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • November 19, 2018
@shphill, Check your html for errors. If you can't find the problem, post the html.

  • February 17, 2020
I'm getting the same problem> @shphill said: > When I click on the link in Preview Mode, it opens a blank page. It does not jump to the bookmark. Any solution found for this thread?

  • March 10, 2020
just curious if anyone has a solution for the blank page in preview mode?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • March 11, 2020
> @jsimp333 said: > just curious if anyone has a solution for the blank page in preview mode? To allow it to work in preview mode: ``` <a href="#MyBookmark" target="_self">Jump to bookmark</a> ```

  • March 11, 2020
Thank you @TomG. What about working with Text Anchors? My code I was using is below but could not get it to show/work in preview mode. They are 2 separate questions but contained within the same page. For the link: a href="#Terms and Conditions">Click here >></a For Anchor: a name="Terms and Conditions"></a

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • March 11, 2020
> @jsimp333 said: > Thank you @TomG. What about working with Text Anchors? My code I was using is below but could not get it to show/work in preview mode. They are 2 separate questions but contained within the same page. > For the link: a href="#Terms and Conditions">Click here >></a > For Anchor: a name="Terms and Conditions"></a That's not anything like the accepted answer above nor the update I posted to your question. Anchor: ``` <div id="Terms">Terms and Conditions</div> ``` Link: ``` <a href="#Terms" target="_self">Click here</a> ```