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

TOPIC: Implement "AJAX"-call

Implement "AJAX"-call 3 years 7 months ago #95327

  • king_and1
  • king_and1's Avatar
  • Offline
  • Junior Lime
  • Posts: 29
  • Karma: 0
Well , so i got the Blue and Gray template where i changed some colors and so on....

The structure still the same.

The first question in my Survey is like : "please type in your serial number"

Well, and thats exactly where i want an Ajax call. After the user finished the input, it should start checking the serial number on a external server and provide an answer if this serial is correct or not .
I´ve searched the question.pstpl(dunno how its correct..) and i´ve found the div_class="answers" and the table´s in it. But i dont know how to specifically target this first question. So i hope this is enough information so we can go on working out this problem , if not please tell me what´s missing and i´m gonna try editing it as good as possible...
The administrator has disabled public write access.

Implement "AJAX"-call 3 years 7 months ago #95334

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6574
  • Thank you received: 1477
  • Karma: 579
I've moved this post to a more appropriate category. And, please don't cross post.

You would place the JavaScript for the AJAX call in the source of the question. See - manual.limesurvey.org/Workarounds:_Manip....29_in_LimeSurvey.3F

So, if you are using the jQuery get() function, the JS would look something like:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		var qID = {QID};
 
		$('#question'+qID+' input[type="text"]').change(function(){
			$.get('http://somedomain.com/customScript.php', { serial: $('#question'+qID+' input[type="text"]').val() } );
		});
	});
</script>

Unfortunately, I can't help you with the PHP coding.
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.
Time to create page: 0.189 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form