Date Picker with Matrix Table | XM Community
Skip to main content
Solved

Date Picker with Matrix Table

  • February 5, 2019
  • 7 replies
  • 131 views

KOgles
Level 3 ●●●
Forum|alt.badge.img+21
Hello - I have found a previous post about using a calendar date picker and was able to get it to work in a free text question. However, I am unable to get the date picker to work with a matrix question. Is the calendar date picker possible on the matrix question? If so, what am I doing wrong? I followed the same steps that got it to work in the free text question.

Best answer by TomG

@KOgles said: > ! > Thanks TomG! Unfortunately, I am not a dev. I am copying, pasting and stumbling through the few things I've picked up here and there. I have attached a screenshot that shows both the matrix text field on inspect and the free text field on inspect. I know that they are different but do not understand what the differences are. The code in the original post used the class InputText to select the text input. In a matrix the input field doesn't have that class, which is why it didn't work. Since you only have one input column in your matrix, you have two options. 1. Change your matrix to a text input form (which has the InputText class) 2. Use the selector `input[type=text]` in place of `.InputText` on the matrix.

7 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • February 5, 2019
> @KOgles said: > Hello - I have found a previous post about using a calendar date picker and was able to get it to work in a free text question. However, I am unable to get the date picker to work with a matrix question. Is the calendar date picker possible on the matrix question? If so, what am I doing wrong? I followed the same steps that got it to work in the free text question. You can attach a date picker to any text input field. The only difference between different types of questions is how you identify and select the text input field. Use the browser's inspect feature to look at the input element and figure out how to select it.

KOgles
Level 3 ●●●
Forum|alt.badge.img+21
  • Author
  • Level 3 ●●●
  • February 5, 2019
! Thanks TomG! Unfortunately, I am not a dev. I am copying, pasting and stumbling through the few things I've picked up here and there. I have attached a screenshot that shows both the matrix text field on inspect and the free text field on inspect. I know that they are different but do not understand what the differences are.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • February 5, 2019
@KOgles said: > ! > Thanks TomG! Unfortunately, I am not a dev. I am copying, pasting and stumbling through the few things I've picked up here and there. I have attached a screenshot that shows both the matrix text field on inspect and the free text field on inspect. I know that they are different but do not understand what the differences are. The code in the original post used the class InputText to select the text input. In a matrix the input field doesn't have that class, which is why it didn't work. Since you only have one input column in your matrix, you have two options. 1. Change your matrix to a text input form (which has the InputText class) 2. Use the selector `input[type=text]` in place of `.InputText` on the matrix.

KOgles
Level 3 ●●●
Forum|alt.badge.img+21
  • Author
  • Level 3 ●●●
  • February 5, 2019
Thank you TomG! Changing to input[type=text] did the trick!!!

Forum|alt.badge.img+5
  • Level 3 ●●●
  • June 23, 2020

TomG I just stumbled on this page. How would I set the javascript to only show the date picker on column 2 of the Matrix?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • June 23, 2020

Forum|alt.badge.img+5
  • Level 3 ●●●
  • June 24, 2020

TomG Thank You!