Form options

Options are set in three layers, where the more particular overrides the more general.

  1. Pre-defined defaults.
  2. User-defined defaults for the global Vue Instance. Passed as the second paramter to the Use statement.
  3. Options for a single form, passed through the options prop.
  • beforeSubmit(form) function This callback allows you to defer submission or prevent it altogether depending on the result of the callback. The callback MUST return a promise object - native or JQuery's Deferred. If and when the promise is resolved the form will be submitted. If it is rejected, the form will not be submitted. Passes through the form instance.
  • layout string Bootstrap's form layout class. Defaults to a vertical block display. other options are form-horizontal and form-inline

    Note: When using a layout other than form-horizontal adjust the top rule of the form-control-feedback class to get the feedback icon aligned with the field.

  • labelWidth number relevant only for horizontal layout. The number of grid columns allocated for the label (out of 12). Defaults to 3.
  • showClientErrorsInStatusBar boolean Show client errors in the status bar, with links to the relevant fields, in addition to the error shown under each field. Useful for long forms. Default: false
  • additionalPayload object Custom data you want to send along with the form. Serves a similar purpose to that of a hidden input field. To insert dynamic data you can change this value on the vue-formular.sending event.
  • sendOnlyDirtyFields boolean when using AJAX form send only the dirty fields. When set to true pristine form submission will be disabled. Default: false.
  • select2Options object - Global options for select2, to be used on vf-select with a select2 or ajax-url prop
  • tinymceOptions object - Global options for tinymce. To be used on a vf-textarea field with a tinymce prop.
  • fileOptions object - Global options for JQuery File Upload, to be used on vf-file with an ajax prop.
  • dateOptions object - Global options for daterangepicker, to be used on vf-date.
  • successTimeout number - Time in ms before hiding the success message after the form was sent using AJAX. Default: 4000
  • customRules object See Validation\Custom Rules
  • messages object see Validation\Messages
  • texts object Default:
{
  sending:'Sending Form...',
  sent:'Form was successfully sent', // this will be presented in case a string is not returned from the server
  singleError:'an error was found:', // status bar errors list title
  errors:'{0} errors were found:',
  // texts for toggling checkbox list values:
  selectAll:'Select All',
  unselectAll:'Unselect All'
}

results matching ""

    No results matching ""