|
1 | 1 | [](https://ko-fi.com/K3K0J5VAD) |
2 | 2 |
|
| 3 | + |
| 4 | + |
3 | 5 | # Form-Validation-React |
4 | 6 |
|
5 | 7 | ### form-validation-react is an easy-to-use npm library that enables developers to add validation rules to form inputs in React. It supports required fields, email formats, and custom rules with various validation functions and options that can be tailored to specific needs. |
|
12 | 14 | - [Validate Required Inputs](#validate-required-inputs) |
13 | 15 | - [Validate Min & Max](#validate-min-and-max) |
14 | 16 | - [Example Reactjs Code](#example-reactjs-code) |
15 | | -- [Licence](#licence) |
| 17 | +- [Licence](#license) |
16 | 18 | ## Installation |
17 | 19 |
|
18 | 20 | You can install the package using npm or yarn: |
@@ -79,13 +81,13 @@ validateRequired: { |
79 | 81 | If a required input is not filled, the rule will return a callback with an array of the not-filled inputs. You can add the action `input_red_border` to change the border color of the not-filled inputs to red. |
80 | 82 |
|
81 | 83 |
|
82 | | -| Parameter | Type | Parameter | Optional | |
| 84 | +| Key | Type | Parameter | Optional | |
83 | 85 | | --- | --- | --- | --- | |
84 | 86 | | `action` | `string` | `input_red_border`,`show_error_message`,`both` | `no` | |
85 | 87 | | `message` | `string` | Message | `yes` | |
86 | 88 | | `applyOnly` | `array ` | **Name** of the inputs | `yes` | |
87 | 89 | | `notvalidated` | `callback function` | notFilledInputs | `yes` | |
88 | | -| `onsuccess` | `callback function` | no values | `yes` | |
| 90 | +| `onsuccess` | `callback function` | no params | `yes` | |
89 | 91 |
|
90 | 92 |
|
91 | 93 | # |
@@ -128,7 +130,7 @@ the `min` in message object is when exceeded minimum the message will show. |
128 | 130 | the `max` in message object is when exceeded maximum the message will show |
129 | 131 |
|
130 | 132 |
|
131 | | -| Parameter | Type | Value | Optional | |
| 133 | +| Key | Type | Parameter | Optional | |
132 | 134 | | --- | --- | --- | --- | |
133 | 135 | | `when` | `string ` | `typing`,`onblur` | `no` | |
134 | 136 | | `message` | `object ` | Messages | `yes` | |
|
0 commit comments