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

TOPIC: Trying to using Ajax

Re: Trying to using Ajax 2 years 8 months ago #72939

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
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.

Re: Trying to using Ajax 2 years 8 months ago #72946

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 805
  • Karma: 369
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,'');
Cheers,
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: 2 years 8 months ago by tpartner.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.149 seconds
Donation Image