Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Answer value

  • Monkeychops
  • Monkeychops's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 5 months ago - 9 years 5 months ago #112842 by Monkeychops
Answer value was created by Monkeychops
How can I get just the value of an answer with expression manager?

I have some javascript code and want to dynamically build a URL with the answer in the URL something like:

www.example.com/?dosomething={Q1Result }

However, when I build a URL like this in code, although it correctly replaces the {Q1Result} it also adds in a SPAN that I do not want.

Is there a way to get only the answer?
Last edit: 9 years 5 months ago by DenisChenu. Reason: example.com : is done for this !!!!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 5 months ago - 9 years 5 months ago #112875 by DenisChenu
Replied by DenisChenu on topic Answer value
Code:
<div id='valueurl'>{Q1Result}</div>
<script>
$(document).on('someevent','on_some_element',function(){
url="http://example.com"+$("#valueurl").text();
)};
</script>
Because your Q1result is dynamic.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 9 years 5 months ago by DenisChenu.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose