Specifying a Text Anchor | XM Community
Solved

Specifying a Text Anchor

  • 18 November 2018
  • 10 replies
  • 509 views

Userlevel 1
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.
icon

Best answer by TomG 18 November 2018, 20:24

View original

10 replies

Userlevel 7
Badge +27
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>
```
Userlevel 1
Tom,

Does the bookmark and link need to be contained within the same question?
Userlevel 7
Badge +27
No, just on the same page.
Userlevel 1
When I click on the link in Preview Mode, it opens a blank page. It does not jump to the bookmark.
Userlevel 7
Badge +27
@shphill,

Check your html for errors. If you can't find the problem, post the html.
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?
just curious if anyone has a solution for the blank page in preview mode?
Userlevel 7
Badge +27
> @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>
```
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
Userlevel 7
Badge +27
> @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>
```

Leave a Reply