abcd-j / schema-form

https://abcd-j.github.io/schema-form/
MIT License
0 stars 0 forks source link

Add config file for specification of standard form options #4

Open jsheunis opened 7 months ago

jsheunis commented 7 months ago

json-editor form options are specified in javascript upon creation of a JSONEditor instance, e.g.:

config = {
      ajax: false,
      schema: my_schema_object,
      theme: 'psyinf',
      iconlib: 'fontawesome5',
      object_layout: 'table',
      disable_edit_json: true,
      disable_properties: true,
      disable_collapse: true,
      remove_empty_properties: true,
      show_errors: 'interaction',
      show_opt_in: false,
      compact: false,
    }
    const form_element = document.getElementById("formeditor");
    editor = new JSONEditor(form_element, config);

To facilitate the use of a template-like "form renderer", it would be ideal for form implementers (not form users) to not have to make any custom changes to the code. The ideal process would be:

Another ideal process could be:

Although, I have to admit I am not certain about the security implications of the latter option.