Join the Team Forms community

Updated last week

Input Fields inside survey component

At a glance

The community member added an input field inside their survey component and would like to add another column for another input field to the right of the first column, as well as have table headers for the first and second columns. A community member suggests using the data-grid component instead of the survey, providing step-by-step instructions on how to achieve the desired output. The instructions include adding a text field in the first column, checkbox fields in the next columns, and another column in the last column of the data grid. The community member also provides an update on how to modify the checkbox columns to function similarly to the survey/radio component by incorporating code in the OnChange event to clear the other checkboxes.

I added an input field inside my survey component by inserting <input></input> inside my questions fields under the Data tab. Output is shown on the second photo.

Now I'd like to add another column for another input field to the right of the first column.
Also, I like to have table headers for the first and second column.
Or are there any other workaround to achieve the same output?

Marked as solution

Hi Yors,

The best way to achieve this would be to use the data-grid component instead of the survey. Heres how I would approach this:

  1. Drag a data-grid into your form. You will notice that the grid contains some component already by default. You should remove them by hovering over them and pressing "x".

  2. Drag a Text Field into the First column. The label you provide will appear in the table header.

  3. Drag Checkbox fields into the next columns. Make sure to uncheck the "Show Label in DataGrid" setting under the display tab of the checkbox settings. This will make it look how it looks in the survey component.

  4. Drag another column into the last column of the data grid.


Here is an example of the final output.


Update:

You can also modify the checkboxes columns in your data-grid to function similarly to those in the survey/radio component (enable only one column to be selected at a time) by incorporating code in the OnChange event to clear the other checkboxes.

  1. Open the component setting to EACH checkbox and navigate to the logic tab.

  2. In the OnChange property add javascript to clear the value of other checkboxes. Here is an example for the (A+) and (AB+) checkboxes

JavaScript
// Clear everything but the a column
row.aB = false
row.b = false
row.c = false
  1. Under the data column of EACH checkbox navigate to the data tab and set the "Redrew On" property to "Any Change"

Here is a example of the final output with this logic applied.



View full solution
E
Y
1 commentยท1 reply

Hi Yors,

The best way to achieve this would be to use the data-grid component instead of the survey. Heres how I would approach this:

  1. Drag a data-grid into your form. You will notice that the grid contains some component already by default. You should remove them by hovering over them and pressing "x".

  2. Drag a Text Field into the First column. The label you provide will appear in the table header.

  3. Drag Checkbox fields into the next columns. Make sure to uncheck the "Show Label in DataGrid" setting under the display tab of the checkbox settings. This will make it look how it looks in the survey component.

  4. Drag another column into the last column of the data grid.


Here is an example of the final output.


Update:

You can also modify the checkboxes columns in your data-grid to function similarly to those in the survey/radio component (enable only one column to be selected at a time) by incorporating code in the OnChange event to clear the other checkboxes.

  1. Open the component setting to EACH checkbox and navigate to the logic tab.

  2. In the OnChange property add javascript to clear the value of other checkboxes. Here is an example for the (A+) and (AB+) checkboxes

JavaScript
// Clear everything but the a column
row.aB = false
row.b = false
row.c = false
  1. Under the data column of EACH checkbox navigate to the data tab and set the "Redrew On" property to "Any Change"

Here is a example of the final output with this logic applied.



This comment has been deleted.