Welcome, Guest
Username: Password: Remember me

TOPIC: filling in a radio button if a multiple choice response is selected

filling in a radio button if a multiple choice response is selected 1 year 3 months ago #97511

  • bwoo5
  • bwoo5's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 4
  • Karma: 0
I have version 1.91 so before EM, so this is through javascript until I can get around to updating.

Q2 is multiple choice.
Q3 is a yes/no radio button.

I need to have the radio button be check yes if option 4 it ticked in the multiple choice and no if it isn't.

Also need for the radio button to be hidden but make sure it fires for quota purposes when they click next.
Last Edit: 1 year 3 months ago by bwoo5.
The administrator has disabled public write access.

filling in a radio button if a multiple choice response is selected 1 year 3 months ago #97516

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6435
  • Thank you received: 840
  • Karma: 249
Set Q3 to hidden
Add Q4 : equation with
{Q3=if(Q2_SQ4=="Y","Y","N")}

And .... wait for next release ( see: bugs.limesurvey.org/view.php?id=7895).
The administrator has disabled public write access.

filling in a radio button if a multiple choice response is selected 1 year 3 months ago #97518

  • bwoo5
  • bwoo5's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 4
  • Karma: 0
Hi Denis,

I understand that is how you would do it in 2.0 with EM but we are actually on 1.91 so i need javascript that will do it. We are looking to upgrade to 2.0 soon, just not at a time where we can do now because of live surveys.
The administrator has disabled public write access.

filling in a radio button if a multiple choice response is selected 1 year 3 months ago #97541

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6435
  • Thank you received: 840
  • Karma: 249
Hello,

With same page ?

Then somethink like that, need updating var at start.
<script>
 
$(function() {
var thisqid=212;
$("#question"+thisqid).hide();
var checkboxid="answerSGQA";
$("#"+checkboxid).click(function(){
if($(this).is(":checked")){
$("#question"+thisqid).find("input.radio[value='Y']").click();
}else{
$("#question"+thisqid).find("input.radio[value='N']").click();
}
}
});
</script>

Denis
PS: i never test javascript put in forum: you have to test and correct it.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.115 seconds
Donation Image