You need to sign in to do that
Don't have an account?
CLICKTOOLS / Javascript
The code below takes the input from question 1 in the survey and writes it back out to the browser. The syntax in the survey tool is ${question_1} for question 1, ${question_2} for question 2, etc.
The problem is that if the response to question 1 is a NUMBER, the script below works fine. BUT if the response is TEXT, the javascript does not work. I am guessing the problem is due to the fact that I don't have quotes around the survey tool variable - but I can't because then the variable will not get set properly.
Any suggestions on how to solve this?
<script type="text/javascript">
document.write(${question_1});
</script>
So if Question 1 = 123123 then
123123 is written to my browser.
BUT if Question 1 = HELLOWORLD then
the Javascript does not work!
HELP!
<textarea id="q2" style="display:none">{!question_2}</textarea>
Then you can refer to the text area from js using getElementById