You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
form.addEventListener('validation', function (e) {
175
175
/* Check if form is valid here. */
176
176
});
177
177
```
178
+
179
+
## Programatically validate a form
180
+
181
+
```ts
182
+
v.validateForm(document.getElementById('form'));
183
+
```
184
+
185
+
## Checking form validity
186
+
187
+
```ts
188
+
v.isValid(document.getElementById('form'))
189
+
```
190
+
191
+
By default it will try to validate the form, before returning whether the form is valid. This can be disabled by setting the `prevalidate` parameter like so:
192
+
193
+
```ts
194
+
v.isValid(document.getElementById('form'), false)
195
+
```
196
+
197
+
You can also supply a callback function to be run after the check.
Similar to checking a forms validity, you can check individual fields too.
206
+
207
+
```ts
208
+
v.isFieldValid(document.getElementById('field'))
209
+
```
210
+
211
+
By default it will try to validate the form surrounding the field, before returning whether the field is valid. This can be disabled by setting the `prevalidate` parameter like so:
0 commit comments