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

TOPIC: Display popup in a right place

Display popup in a right place 3 years 2 months ago #100086

  • aidilo
  • aidilo's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Hi..
I have one situation here which I want to display a popup.
For example, at the 2nd page, I have Q1, Q2 and Q3. When i want to go to the next page and if the system cannot save sum of the data into the database, a popup will display before it go to the next page, which is mean bfore it go to the 3rd page. I have created one and put it in Q1. but the result is the popup display before it go to the 2nd page, where actually it should display on the 2nd page. Here im using the script below. Where should i put the script actually to make the popup display in a right place.


if ($("#answer21639X4X134").val() == "") {
alert("Recheck.");
parent.location.href = "http://localhost/123/popup.php";

}

Any help would be appreciated..
Last Edit: 3 years 2 months ago by aidilo.
The administrator has disabled public write access.

Display popup in a right place 3 years 2 months ago #100089

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6575
  • Thank you received: 1477
  • Karma: 579
JavaScript can only work on the page where it is placed so if you want an alert on page 2 you will need to put the script there.

You may need to use {INSERTANS} or Expression Manager to access the previous answer(s).
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: aidilo
Time to create page: 0.201 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form