Limit selection in one column for Matrix field?

  • DoraAlmassy
    Asked on October 2, 2015 at 3:32 AM

    Hello all,

    Have you found a solution for the problem above? I would like to do the same and can't find a solution. Many thanks, 

  • DoraAlmassy
    Replied on October 2, 2015 at 3:46 AM

    The option, which you suggested could work (interchanging columns and rows), however, the text I have for options are quite long and and it does not fit in the columns properly. Is there an other widget that I could use alternatively? 

  • Charlie
    Replied on October 2, 2015 at 3:54 AM

    Hi,

    I checked your account and I see that your latest form has this Matrix field:

    Limit selection in one column for Matrix field? Image 1 Screenshot 20

     

    The "1. Development of a strategic framework" seems to be the selection you want to limit, is that correct? I see that it will indeed make the column headers quite long. I believe this is how the Matrix field was designed, the columns will be the available options that the questions (on each row) can select.

    If you want to order the items, would the Orderable list widget work? You can also check the Visual Multi Select widget.

    Let us know your thoughts.

  • DoraAlmassy
    Replied on October 2, 2015 at 4:04 AM

    Many thanks. In the visual multi select widget, can I limit the number of choices? I.e. I have 6 options but it will only let them to drag three to the right side?

    I want respondents to rank only the three most important items, so not to waste time on the rest.  

  • Boris
    Replied on October 2, 2015 at 6:30 AM

    Yes, this is possible with a little use of custom CSS. :) (We do not have this as a feature, unfortunately, but my test with custom CSS seems to work wonderfully.)

    Please click on the wand-shaped icon of your Multi Select widget. In the popup that opens, switch to the Custom CSS tab, and paste the following code:

    .ms-elem-selectable.ms-selected ~
    .ms-elem-selectable.ms-selected ~
    .ms-elem-selectable.ms-selected {
    display: list-item !important;
    visibility: hidden;
    }
    .ms-elem-selectable.ms-selected ~
    .ms-elem-selectable.ms-selected ~
    .ms-elem-selectable.ms-selected:after {
    visibility: visible;
    content: "";
    background: #fff;
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: .7;
    }

    Limit selection in one column for Matrix field? Image 1 Screenshot 20

    It will gray-out the field when 3 items are selected, and you can see a demo form of this code in action, here:

    https://secure.jotformpro.com/form/52743016230949

    Please let us know how it goes.

  • DoraAlmassy
    Replied on October 2, 2015 at 7:54 AM

    Thank you very much, it works just perfectly! 

    I have a suggestion for future development: Would it be possible to move the selections also with the arrows between the two boxes?  If the options selected and somebody wants to change the selection, it is not straightforward to understand how the selections can be moved back to the original box. Maybe it is just me, but I keep on clicking on the arrows. So it would be great if the respondents could move back the boxes both with the arrows and by clicking on them.   

  • Charlie
    Replied on October 2, 2015 at 9:32 AM

    We have a widget that has arrows that can move the selections. You can check Dual Listbox widget. The Visual Multi Select widget has a different approach though, the arrow in the middle would be for aesthetic purposes, and the items easily moves back from the other box panel on a click and not by an arrow button. If the Dual Listbox widget will not work, I can send a feature request for the Visual Multi Select widget as per your description for future improvements. 

    Let us know your thoughts.

    Thanks

  • jeff.jacobs.bcba
    Replied on October 4, 2015 at 8:02 PM

    The script works nicely. PROBLEM (nothing to do with the script) that the number of characters available per line in the "select values" box is limited=after a certain number of characters the characters or words are not visible. That means the boxes containing the "values" should be expandable and probably need to be placed vertically above each other vs side-by side. This could be an option within the widget for longer text.

     

    Jeff

  • mert JotForm UI Developer
    Replied on October 5, 2015 at 7:35 AM

    Hi Jeff,

    Maybe, you can try to adjust width value of the widget field to overcome the overflowing text issue.

     

    To do that,

    When the widget field is selected with mouse, click to "Width" and set its value to higher.

    Limit selection in one column for Matrix field? Image 1 Screenshot 20

     

    If you need further assistance, please let us know.

    Thanks.

  • jeff.jacobs.bcba
    Replied on October 6, 2015 at 7:06 AM

    You are correct-thanks.

     

    BUT-At a certain # of characters they disappear, but are still on the one of the lines.If you create 2 lines of text the box (Option line) becomes higher and text/characters disappear (are not visible on the form)

  • Charlie
    Replied on October 6, 2015 at 8:42 AM

    @jeff.jacobs.bcba

    To better assist you and discuss the details of your concern, I went ahead and opened a separate thread for it, please refer to this link instead: http://www.jotform.com/answers/677093. We will address it shortly.

    Thank you