The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Show Full responses in Completed page

Show Full responses in Completed page 2 months 1 week ago #93405

  • agabriel
  • agabriel's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Hi!LS Team,

Im running a survey that give a voucher to first 2,000 people only but accept unlimited people to answer the survey.

Im wondering if LS have a javascript code that can get the Full responses in a survey. Ill be inserting this code in the completed page template

Heres a sudo code example:
function get_voucher_button{
var total_responses = {TOTAL_RESPONSES}; //i dont know the placeholder for Total Responses
  if(total_responses > 2000){
   alert("sorry you didnt qualify for this voucher")
  }else{
   alert("click here to download voucher");
  }
}

Hope you can help me.

More power

Ali
Last Edit: 2 months 1 week ago by agabriel.
The administrator has disabled public write access.

Show Full responses in Completed page 2 months 1 week ago #93421

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 4378
  • Thank you received: 451
  • Karma: 165
Hello,

Maybe you can use {SAVEDID} but it take the id if user don't finish him survey.

Alternative solution: use ajax on end message or your own script at endurl.

Denis
The administrator has disabled public write access.

Show Full responses in Completed page 2 months 1 week ago #93496

  • agabriel
  • agabriel's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Hi Denis!

is there a way i can query the database using Javascript?
The administrator has disabled public write access.

Show Full responses in Completed page 2 months 1 week ago #93497

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 4378
  • Thank you received: 451
  • Karma: 165
agabriel wrote:
is there a way i can query the database using Javascript?
No, not really.

You have to use own php script and call it in AJAX: api.jquery.com/jQuery.ajax/

Denis
The administrator has disabled public write access.
The following user(s) said Thank You: agabriel
  • Page:
  • 1
Moderators: DenisChenu, ITEd
Time to create page: 0.219 seconds
Donation Image