From dbc691c61ea5d112e7d9e3f393856574ac5d1d37 Mon Sep 17 00:00:00 2001 From: Dixsie Date: Wed, 24 Mar 2021 06:33:30 -0500 Subject: Add form quick start documentation Form quick start documentation contains info on using the form and form group components, and the Vuelidate plugin. This doc also provides a template for creating a new form. Signed-off-by: Dixsie Wolmers Change-Id: I5d05141ff05cd069e55853a8b2cb4adecb3c848a --- docs/guide/quickstart/forms.md | 126 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 docs/guide/quickstart/forms.md (limited to 'docs/guide') diff --git a/docs/guide/quickstart/forms.md b/docs/guide/quickstart/forms.md new file mode 100644 index 00000000..5356eac0 --- /dev/null +++ b/docs/guide/quickstart/forms.md @@ -0,0 +1,126 @@ +# Forms + +Forms are created using the [bootstrap-vue form +component](https://bootstrap-vue.org/docs/components/form) +and validated with the [Vuelidate](https://vuelidate.js.org/#sub-installation) +plugin. + +## Form component + +When creating a new form, use the `` [form +component](https://bootstrap-vue.org/docs/components/form). Use the `.prevent` +event modifier on submit to prevent the submit event from reloading the page. + +## Form group component + +The `` [form group +component](https://bootstrap-vue.org/docs/components/form-group) +pairs form controls with a legend or label, helper text, invalid/valid +feedback text, and visual validation state feedback. Learn more about +commonly used form components: + +- [Form checkbox](https://bootstrap-vue.org/docs/components/form-checkbox) +- [Form input](https://bootstrap-vue.org/docs/components/form-input) +- [Form radio](https://bootstrap-vue.org/docs/components/form-radio) +- [Form select](https://bootstrap-vue.org/docs/components/form-select) +- [Form file custom component](/guide/components/file-upload) + +When helper text is provided, use the `` component and `aria-describedby` on the +form group component the helper text describes. + +## Validation + +For custom form validation messages, disable browser native HTML5 +validation by setting the `novalidate` prop on ``. Use Vuelidate to +check the form validation state and add +custom validation messages in the `` component. + +When creating a new form add the `VuelidateMixin` +to the `scripts` block and import any +[validators](https://vuelidate.js.org/#validators) needed +such as: `required`, `requiredIf`, etc. The use of built-in validators is +preferred. + +## Complete form + +A complete form will look like this. + +```vue + + + +``` -- cgit v1.2.3