@michalzard/svelte-forms 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
# Svelte
|
|
1
|
+
# Svelte Form Validation
|
|
2
2
|
|
|
3
|
+
Svelte 5 Form validation made simple.
|
|
3
4
|
In order to define `intialValues` you pass [valibot](https://www.npmjs.com/package/valibot) schema.
|
|
4
5
|
|
|
5
6
|
## Usage example:
|
|
@@ -50,8 +51,6 @@ In order to capture submitted values you simply do:
|
|
|
50
51
|
<form onsubmit={handleSubmit}>
|
|
51
52
|
```
|
|
52
53
|
|
|
53
|
-
In order to capture value from input,textarea or anything else you simply do:
|
|
54
|
-
|
|
55
54
|
To update each value you can simply use `bind:value` to individual writable signals,i.e `$values.email`
|
|
56
55
|
To mark any input element as `touched` you can use `markTouched` function with the name of the field in order for form to track its `touched` state,that way you can display errors conditionally only if you interacted with the form input, without using `$touched.<fieldname>`, you'd be displaying errors immediately.
|
|
57
56
|
|