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

TOPIC: Trying to using Ajax

Trying to using Ajax 4 years 8 months ago #72939

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 84
  • Karma: 37
If the function is generic enough, we could consider adding it to EM. That way, from 1.92 RC3, you could use the new em_validation_q question option to call your function and validate the website. If the website is invalid, the background color for the question will turn red.
The administrator has disabled public write access.

Trying to using Ajax 4 years 8 months ago #72946

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6415
  • Thank you received: 1433
  • Karma: 558
Hmm...I see a syntax error. This line:
if (result == "invalid") (
Should be this:
if (result == "invalid") {

You are correct, you will need to use {INSERTANS} to define the var url if your text input is on a previous page.

Fix the syntax error and see if you get any alerts at all.

I assume that verifyURL.php is in the root of your LimeSurvey installlation (at least that's what the path is in your code).

You may need to clean up the returned value from verifyURL.php before your IF statement (remove any spaces, etc.):
result = result.replace(/[\s]/g,'');
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 years 8 months ago by tpartner.
The administrator has disabled public write access.
Time to create page: 0.355 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form