Adding number of desirable rows dynamically in Matrix table | XM Community
Skip to main content

I am trying to get some responses in a Matrix table-type but different respondents can have different number of entries (rows). I want to allow the respondent to increase the number of rows in the matrix while s/he is filling the table.

For example, I will build a matrix with 5 rows and 4 columns. The respondent might have 7 entries. So they should have an option of adding 2 rows.

Is there any way to automate this so that if the respondent does enter something in this last "Other" statement, another row appears that says also says "Other (please specify)" with text entry allowed. Ie, so that if a respondent does enter something, they can enter something else in the new row, but so that not all respondents have to see multiple "Other" rows if they aren't going to enter anything.

What would be the JavaScript for this type of question? 

 

I have had a similar requirement but with less number of columns. So, I used a Form Field type question but it is again limited on having the option of customizable number of text entry boxes. Hope this idea might help you as a temporary solution


@Siva Sai I have 14 columns for entry and I tried to use form field but it doesn’t allow me to add more columns. Did you have the same problem?


@Davis Pier Nope, I just revalidated and can see that Form Field question type has a higher limit on the number of fields. Attaching a image for better understanding

 


@Siva Sai Thank you for your help but I’m looking to add more columns. Unfortunately, form field only adds more rows. 


It should have been a tempoaray issue with the instatnce being woked on. Did you try creating a new question before reaching out to support?


@Siva Sai Yes, I tried everything. As a reference, this is the table I’m planning to add more rows to. They should be able to add up to 20 staff members.

 


I just retried now and yes I am able to add more rows than this. I would suggest to refresh your account and give a try creating a new question. The limit is definitely more as you have seen in the screenshot above. Hope the account refresh helps.


Hi @Davis Pier ,

 

I did this with a simple text entry question few years ago but don’t remember the code. From what I remember, I can give you an idea on how I did it.

 

I added all the other textboxes in advance and hide all of them except the 1st Open end. Then added js to unhide the next one by adding “onkeydown” event, where I added a function to unhide the next Open End choice and same on next “onkeydown” event and so on.

Hope this helps :)

 

Regards,

PD


Leave a Reply