Form Reform Data Picker extends Form Reform with data picking input blocks.
The input blocks are configured by associating them with an HTML table or JSON data. These can be provided by Universal Content Puller or any other HTML table.
These inputs all work in a similar way to attach to an HTML or JSON table and populate the form input from that table.
Getting Started
Before adding any Form Reform Data Picker block, the page needs to present some data as a table. This table could be rendered by Universal Content Puller or by any other table generating block such as MSV Table or the core Content block, or any addon that presents addon specific data as a table.
The table should have complete rows and columns, so no colspan or rowspan cells. It should also ideally have a row of column headings within a <thead> section and row headings within a <th> element at the start of each row. Nevertheless, Form Reform Data Picker can work with numeric indexes should column or row headings not be available.
Form Reform already has some very flexible input blocks for checkbox and radioset lists and matrices, and various select and grouped select inputs. The benefits of Form Reform Data Picker come when the data is large or dynamic, when you already have a table, or when you have specific format requirements. For example, where pulled from an uploaded and updated CSV, from a database query, or from an external source such as an API.
The Table Picker input attaches to the table and superimposes a matrix of checkboxes. Clicking a table cell toggles that cell's checkbox. The checkbox inputs are submitted as a 2D array by row and column name or index. The values of the checkboxes are fully configurable and could be a simple boolean, the value of the table cell, or compounded from row, column and value. If the value options available are not enough, the options can be reconfigured at jl_form_reform.form_reform_data_picker.value_formats.
The Table as Select input populates a grouped select input from the table before hiding or destroying the table. The JSON as Select input is similarly populated from a hidden data attribute of JSON data.
The grouping of the select is configurable by row or column, with the individual selectable items then corresponding to the other axis of the table. However, the labels for the select options and the values for the select options can be independently configured as the value of the table cell, or compounded from row, column and value in various permutations from the same set options as the Table Picker input.
The Result Picker input block is a highly specialized derivative of the Table Picker. It can attach to any listing of the FormReformDefault store generated by the blocks from Form Reform Display to enable one or more previous form submissions to be picked. This can be used to create multiple stage workflows through a series of forms.
You can see these specialised form inputs in action in our Example - Picking Data demonstration page. Feel free to submit the example form as often as you want. The form is saved to your session, but the data is not saved or logged anywhere else.
Form Reform Data Picker requires Form Reform and is free to those who have purchased Form Reform. Just send me your license details for Form Reform and I will grant you a free license to this extension.