Skip to content

LORIS Form

christinerogers edited this page Oct 19, 2016 · 30 revisions

under construction


As of LORIS 17.0 (future release late 2016), Loris Form will replace HTML QuickForm

Loris Form permits only specific element types (to be confirmed):

  • dropdown select
  • multiselect
  • textbox (brief text answers)
  • text area
  • numerical
  • date
  • label
  • score columns (static for calculated values, not for data entry)

Note on Radio buttons and Checkboxes

Radio buttons and checkboxes are not allowed by Loris Form for a very important reason: distinguishing No from Not Answered in data entry responses is critical for statistical validity of clinical data.

  • A checkbox left blank doesn’t distinguish a No response from Not Answered (or Ignored)
  • Each individual radio button is treated by PHP as a separate form element and so would require a separate database field for every valid response to a single question. For binary (yes/no) questions, a select-dropdown (options: yes/no/NotAnswered) is still preferable anyway, in order to distinguish No from Not Answered.

How to update PHP QuickForm instruments to LorisForm

This section is ONLY for existing projects updating to Loris 17.0

Since LorisForm is designed to match QuickForm, switching your instruments to LorisForm couldn't be easier:

Find this line in your PHP Quickform instrument:

   $this->form = new HTML_Quickform('test_form');

and replace it with this line:

    $this->form = new LorisForm('test_form');

You're done. There's no need to modify any other code or configurations or tables -- just don't forget to run composer install --no-dev and then composer dump-autoload to update dependencies and re-generate the autoload.php file.
Database tables and data are unaffected by the switch to LorisForm.

For a few examples, see our LorisForm updates to the sample instruments provided in the docs/ directory

Clone this wiki locally