Form options
Options are set in three layers, where the more particular overrides the more general.
- Pre-defined defaults.
- User-defined defaults for the global Vue Instance. Passed as the second paramter to the
Use
statement. - 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 areform-horizontal
andform-inline
labelWidth
number
relevant only for horizontal layout. The number of grid columns allocated for the label (out of 12). Defaults to3
.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 thevue-form.sending
event.sendOnlyDirtyFields
boolean
when using AJAX form send only the dirty fields. When set totrue
pristine form submission will be disabled. Default:false
.select2Options
object
- Global options for select2, to be used onvf-select
with aselect2
orajax-url
proptinymceOptions
object
- Global options for tinymce. To be used on avf-textarea
field with atinymce
prop.fileOptions
object
- Global options for JQuery File Upload, to be used onvf-file
with anajax
prop.dateOptions
object
- Global options for daterangepicker, to be used onvf-date
.successTimeout
number
- Time in ms before hiding the success message after the form was sent using AJAX. Default: 4000customRules
object
See Validation\Custom Rulesmessages
object
see Validation\Messagestexts
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'
}