Welcome, Guest
Username: Password: Remember me

TOPIC: Show Full responses in Completed page

Show Full responses in Completed page 1 year 7 months ago #93405

  • agabriel
  • agabriel's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • 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: 1 year 7 months ago by agabriel.
The administrator has disabled public write access.

Show Full responses in Completed page 1 year 7 months ago #93421

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
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 1 year 7 months ago #93496

  • agabriel
  • agabriel's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • 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 1 year 7 months ago #93497

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
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
Moderators: ITEd
Time to create page: 0.102 seconds
Donation Image