Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: 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 Jahr 4 Monate her #97511

  • bwoo5
  • bwoo5s Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 80
  • Dank erhalten: 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.
Letzte Änderung: 1 Jahr 4 Monate her von bwoo5.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

filling in a radio button if a multiple choice response is selected 1 Jahr 4 Monate her #97516

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6551
  • Dank erhalten: 868
  • Karma: 257
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).
Der Administrator hat öffentliche Schreibrechte deaktiviert.

filling in a radio button if a multiple choice response is selected 1 Jahr 4 Monate her #97518

  • bwoo5
  • bwoo5s Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 80
  • Dank erhalten: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

filling in a radio button if a multiple choice response is selected 1 Jahr 4 Monate her #97541

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6551
  • Dank erhalten: 868
  • Karma: 257
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.123 Sekunden
Donation Image