Welcome to the LimeSurvey Community Forum

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

Is it possible for me to use javascripte to read session in the start.pstpl

  • mrli999
  • mrli999's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 11 months ago #107471 by mrli999
Is it possible for me to use javascripte to read session in the start.pstpl? if yes, how? thanks again.

In more details:

If there is a session variable exampleid. In some case it's value is 99999999, other 99999998.

In the startpage.pstpl, I would like to check the value is 99999999 or 99999998. If it is 999999, alert and jump to a customer page (such as www.example.com/example/login.php ). If it is 99999998, go ahead and pass 9999998 to a question in the survey.

Is it possbile? And how?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 11 months ago #107478 by DenisChenu
This need to be done in ajax, not in js only.

Or you can just use cookies :
- www.quirksmode.org/js/cookies.html
- developer.mozilla.org/en-US/docs/Web/API/document.cookie

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.
The following user(s) said Thank You: mrli999
The topic has been locked.
  • mrli999
  • mrli999's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 11 months ago #107481 by mrli999
Thank you very much, Densi!

Is ajax very diffculty? If possbile, would you please let me know how to read the session using ajax? thanks again!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose