Welcome, Guest
Username: Password: Remember me

TOPIC: Pre-set answer in radioboxes array

Pre-set answer in radioboxes array 4 years 6 months ago #57590

  • martijntk
  • martijntk's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Regarding a social network analysis questionnaire, I would like to use an array-like approach

name 1
name 2
name 3
name 300

The option "never" should be pre-set standard, because it is likely that respondents know a few of the others and will have to select only a few names. Is it possible to have the radioboxes under "NEVER" all checked standard?
The administrator has disabled public write access.

Pre-set answer in radioboxes array 4 years 5 months ago #57602

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 5082
  • Thank you received: 1046
  • Karma: 438
If you're using a simple array with radio buttons, the following should work.

Set up your survey to use JavaScript and place the following script in the source of the array question. Replace "QQ" with the array question ID.

The script will loop through all rows and if no checked radios are found, the last one in that row will be checked.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		var qID = QQ;
		$('#question'+qID+' table.question tbody tr').each(function(i) { 
			if($('input.radio:checked', this).length < 1) {
				$('input.radio:last', this).attr('checked', true);
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.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.159 seconds