Welcome to the LimeSurvey Community Forum

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

Array - Text (Col1), Text (Col2), Slider(Col3)

More
5 months 1 week ago - 5 months 1 week ago #269736 by Joffm
Hi,
this thread is nearly 3 years old.
So, at least you should have provided a lss export of this/these relevant question/s.

Because I do not see an issue
 
Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 months 1 week ago by Joffm.

Please Log in to join the conversation.

More
5 months 1 week ago - 5 months 1 week ago #269742 by 2022needhelp
Hi,

yes sure. Here is the lsg export of the question. Thank you for the help.

 
Last edit: 5 months 1 week ago by 2022needhelp.

Please Log in to join the conversation.

More
5 months 1 week ago #269746 by Joffm
Neither lsq nor lsg export, only lss exports, please.

at least you should have provided a lss export

Copy the survey, remove everything not related to your problem, send the lss exoort of this relevant part.

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
5 months 1 week ago - 5 months 1 week ago #269749 by 2022needhelp
All right, here is the export as lss.
Last edit: 5 months 1 week ago by 2022needhelp.

Please Log in to join the conversation.

More
5 months 1 week ago #269751 by Joffm
Hi,
first some hints.
1. It's not necessary to enter the "dropdown"-script several times.
Code:
        // Insert selects
        $('.answer-item.answer_cell_3', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
                                                    <option value="">Please select...</option>\
                                                    <option value="1">Option1</option>\
                                                    <option value="2">Option2</option>\
                                                    <option value="3">Option3</option>\
                                                    <option value="4">Option4</option>\
                                                </select>');
        $('.answer-item.answer_cell_4', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
                                                    <option value="">Please select...</option>\
                                                    <option value="1">Value1</option>\
                                                    <option value="2">Value2</option>\
                                                    <option value="3">Value3</option>\
                                                    <option value="4">Value4</option>\
                                                    <option value="5">Value5</option>\
                                                    <option value="6">None of the above</option>\
                                                </select>');
 
is sufficient.

2. Do you really want to store the text of the answer options. 
To store the values change this
Code:
     // Returning to page
    $('.with-select input:text', thisQuestion).each(function(i) {
      var thisCell = $(this).closest('.answer-item');
      var inputText = $.trim($(this).val());
      $('select.inserted-select', thisCell).val(inputText);
    });

to
Code:
    // Returning to page
    $('.with-select input:text', thisQuestion).each(function(i) {
      var thisCell = $(this).closest('.answer-item');
      var inputText = $.trim($(this).val());
      var selectval = $('select.inserted-select option', thisCell).filter(function () { return $(this).html() == inputText; }).val();
      $('select.inserted-select', thisCell).val(selectval);
    });

3. In my opinion it is better to set the column of the slider in the variable
Code:
        // The column to receive the sliders
        var sliderColumn = 5;
        ...
        var sliderColumn = 6;
 
instead of setting it always to "1" and adding an offset at several places.

Well, now your question
1. You did not set any slider width. If you set the label width to "hidden" and the slider width to 100% the next issue occurs.
2. Because the column is rather small the bootstrap media query is used which sets the width of the slider container to 66.6%.
You have to adjust this.
Code:
@media (min-width: 768px) {
  .col-md-8 {
    flex: 0 0 auto;
    flex-grow: 0;
    width: 100% !important;
  }

And here the result (styling if the slider is a relict of an old survey of mine)
 

And your lss back (I removed the "autocomplete" part.)
BTW: Why didn't you use one of the several "autocomplete" examples of the forum?
 

File Attachment:

File Name: limesurvey...22_J.lss
File Size:82.85 KB


Joffm



 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: 2022needhelp

Please Log in to join the conversation.

More
5 months 1 week ago #269756 by 2022needhelp
Many thanks for the quick help. It works perfectly. Thanks also for the tip with the dropdown script!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose