Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Multiple question types in array modifiy

  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
10 years 2 months ago #103235 by Mazi
Replied by Mazi on topic Multiple question types in array modifiy
"Not working" is not a very helpful error description. Please always post a link to an activated demo survey so we can have a look at the HTML source code.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
10 years 2 months ago #103237 by MikeConom
Replied by MikeConom on topic Multiple question types in array modifiy
Mazi

yes it was mistake becuse i didnt give more informations about this.
Now i am not working with the side by side
when i test it again i'll sent more informations

Thanks and happy new year
The topic has been locked.
More
9 years 11 months ago #106599 by quadrellis
Replied by quadrellis on topic Multiple question types in array modifiy
Hi Tpartner et al,

Thanks for your code that allows the addition of a textbox adjacent to a yes no array.

Is it possible to put the text input box in the last column ther the two Yes/No array columns ?

Cheers,

Scott
The topic has been locked.
More
9 years 10 months ago - 9 years 10 months ago #108198 by Erwinx2
Replied by Erwinx2 on topic Multiple question types in array modifiy



Hello,

I have made some JavaScript modifications. It allows to merge elements of two questions into one question. If you can read JavaScript you can easily adapt it. The code should be resist in template.js of your LimeSurvey-template:

Code:
 function pslSurvey(idStr,idStr1) 
{
  var $removed = $('#'+idStr).children().eq(0).remove();
  var $content = $('#'+idStr).html();
  $('#'+idStr1).append($content);
  return;
}
 
$(document).ready(function(){
  //return;
  var $myTr    = $('#javatbd969997X11X168SQ001');
  if ( $myTr.length){
    pslSurvey('javatbd969997X11X184SQ001','javatbd969997X11X168SQ001');
    $('#javatbd969997X11X168SQ001').parents().eq(1).children().eq(1).children().eq(0).append('<th class=\"answertext\">männlich</th>');
    $('#javatbd969997X11X168SQ001').parents().eq(1).children().eq(1).children().eq(0).append('<th class=\"answertext\">weiblich</th>');
    pslSurvey('javatbd969997X11X184SQ002','javatbd969997X11X168SQ002');
    pslSurvey('javatbd969997X11X184SQ003','javatbd969997X11X168SQ003');
    pslSurvey('javatbd969997X11X184SQ004','javatbd969997X11X168SQ004');
    pslSurvey('javatbd969997X11X184SQ005','javatbd969997X11X168SQ005');
    pslSurvey('javatbd969997X11X184SQ006','javatbd969997X11X168SQ006');
    $('#question184').empty();
  }
    //console.log($debug);
});


What it does:

  • remove unnecessary column
  • grab content from the second question
  • put content to the first question
  • extentend labels/column header of the first question
  • remove the second question






  • PS: If you can't read JavaScript, I might help... NO ADVERTISING!
    Last edit: 9 years 10 months ago by tpartner.
    The topic has been locked.
    • Mazi
    • Mazi's Avatar
    • Offline
    • Official LimeSurvey Partner
    • Official LimeSurvey Partner
    More
    9 years 1 month ago #116656 by Mazi
    Replied by Mazi on topic Multiple question types in array modifiy
    Erwinx2, which template did you use for your modifications?

    Best regards/Beste Grüße,
    Dr. Marcel Minke
    Need Help? We offer professional Limesurvey support: survey-consulting.com
    Contact: marcel.minke(at)survey-consulting.com
    The topic has been locked.

    Lime-years ahead

    Online-surveys for every purse and purpose