Implement "AJAX"-call

4 years 11 months ago #95327 by king_and1
king_and1 created the topic: Implement "AJAX"-call
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...

Please Log in or Create an account to join the conversation.

4 years 11 months ago #95334 by tpartner
tpartner replied the topic: Implement "AJAX"-call
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 -

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('', { serial: $('#question'+qID+' input[type="text"]').val() } );

Unfortunately, I can't help you with the PHP coding.

Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!