Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: how to get the question answer in javascript?

how to get the question answer in javascript? 2 years 2 months ago #108973

  • iscar
  • iscar's Avatar
  • Offline
  • Banned
  • Posts: 312
  • Thank you received: 1
  • Karma: -4
i have a survey, which has 2 questions q1,q2.
i would like to add javascript in q2, i tried
<script type="text/javascript" charset="utf-8">
var q1answer={ q1.shown };
but canot get the value, i checked the manual, no content about it.
thanks for any help!
The administrator has disabled public write access.

how to get the question answer in javascript? 2 years 2 months ago #108984

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1798
  • Thank you received: 440
  • Karma: 110
hello,
I've got few idea but I think you have to remove the white-spaces included inside { q1.shown }
If not, your expression won't be parsed...
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.

how to get the question answer in javascript? 2 years 2 months ago #108989

  • iscar
  • iscar's Avatar
  • Offline
  • Banned
  • Posts: 312
  • Thank you received: 1
  • Karma: -4
i see,thanks for your reply!
i just confused by the blank,{,“,(
Last Edit: 2 years 2 months ago by iscar.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.176 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form