Skip to content

Commit 93ac1b7

Browse files
committed
docs: add novalidate to tutorial closes #4466
1 parent ea2f58f commit 93ac1b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/src/pages/tutorials/basics.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ First, start by adding some markup, you can start by having a `form` wrapping a
8181
```vue
8282
<template>
8383
<div id="app">
84-
<form>
84+
<form novalidate>
8585
<input type="email" name="email" />
8686
8787
<button>Sign up for newsletter</button>
@@ -100,6 +100,8 @@ You will notice that the form submits and you should see `?email=` added in your
100100

101101
This is the native HTML form submission behavior. Usually, in modern applications, you don't want that and you prefer to handle submission with JavaScript.
102102

103+
The `novalidate` attribute on the `<form>` element is meant to disable the native HTML form validation, we will get to validating the form by the end of this tutorial.
104+
103105
<div class="tutorial-step">
104106

105107
Add a `submit` event handler that prevents the native form submission, we will use `onSubmit` function to handle our form submission.
@@ -109,7 +111,7 @@ Add a `submit` event handler that prevents the native form submission, we will u
109111
```vue{3,13-17}
110112
<template>
111113
<div id="app">
112-
<form @submit.prevent="onSubmit">
114+
<form novalidate @submit.prevent="onSubmit">
113115
<input type="email" name="email" />
114116
115117
<button>Sign up for newsletter</button>
@@ -144,7 +146,7 @@ VeeValidate exposes 2 components that you will be using regularly, the `<Field>`
144146
Import them and register them on the Vue component, then replace the following elements with the vee-validate component:
145147

146148
- Replace `<input>` with `<Field />` while keeping the same attributes.
147-
- Replace `<form>` with `<Form />` but remove the `.prevent` modifier.
149+
- Replace `<form>` with `<Form />` but remove both the `.prevent` modifier and the `novalidate` attribute.
148150

149151
</div>
150152

0 commit comments

Comments
 (0)