Quantcast
Channel: Topics in Category: Can I do this with LimeSurvey? - LimeSurvey forums
Viewing all articles
Browse latest Browse all 17529

Question condition with javascript - by: tpartner

$
0
0
Okay, so depending on what the PHP script returns, the call could be something like this:
$.ajax({
	url: 'ajax.php',
	dataType: 'html',
	data: {var1: 1}, // Data passed to the PHP function
	success: function(results){
		if(results = 1) {
			$('#question123 input.radio:first').click();
		}
		else {
			$('#question123 input.radio:last').click();
		}
	},
	error: function(){
		alert('Fail!');
	}
});

Viewing all articles
Browse latest Browse all 17529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>