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

TOPIC: Trying to using Ajax

Trying to using Ajax 3 years 6 months ago #72939

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 83
  • 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 3 years 6 months ago #72946

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 5018
  • Thank you received: 1035
  • Karma: 431
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 3 years 6 months ago by tpartner.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.138 seconds