Skip to content

Commit b0812d5

Browse files
author
Edward Xiao
authored
Update README.md
1 parent 3fdf041 commit b0812d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
2929
* <a href="https://codesandbox.io/s/custom-function-further-control-when-providing-customfunc-yjwch">Custom function further control</a>(when providing ```customFunc```)
3030
* <a href="https://codesandbox.io/s/q9vqmk4j84">Example of custom locales</a>(when providing ```window.REACT_INPUTS_VALIDATION['customErrorMessage']```)
3131
* <a href="https://codesandbox.io/s/13qo2rqxjj">Example of phone and email validation</a>(handled with ```customFunc```)
32-
* <a href="https://codesandbox.io/s/async-checking-via-customfunc-emqgw">Example of checking username existence (suggest not using asyncMsgObj) </a>(handled with ```customFunc```)
32+
* <a href="https://codesandbox.io/s/async-checking-via-customfunc-emqgw">Example of checking username existence (suggest not using asyncMsgObj. And it is for ```<Textbox>``` and ```<Textarea>``` only) </a>(handled with ```customFunc```)
3333
* <a href="https://codesandbox.io/s/asyncmsgobj-blmce">Example of asyncMsgObj </a>(when providing ```asyncMsgObj```)
3434

3535
# Docs Link
@@ -95,7 +95,7 @@ Tested on IE9+ and Chrome and Safari(10.0.3)
9595
|**validationOption.max** |**Opt**|**Num**|**Validation of max length when validationOption['type'] is string, max amount when validationOption['type'] is number.**|**0** |
9696
|**validationOption.length** |**Opt**|**Num**|**Validation of exact length of the value.**|**0** |
9797
|**validationOption.compare** |**Opt**|**Str** |**Compare this value to 3 to see if they are equal.**|**""** |
98-
|**<a name="customFunc"></a>validationOption.customFunc** |**Opt**|**Func**|**Custom function. Returns true or err message.**| **none** |
98+
|**<a name="customFunc"></a>validationOption.customFunc** |**Opt**|**Func**|**Custom function. Returns true or err message or { error: true, message: 'message', showOnSuccess: true }.**| **none** |
9999
|**validationOption.reg** |**Opt**|**Bool**|**Custom regex.**|**""** |
100100
|**validationOption.regMsg** |**Opt**|**Str** |**Custom regex error message.**|**""** |
101101
|**validationOption.locale** |**Opt**|**Str** |**For error message display. Current options are ['zh-CN', 'en-US']; Default is 'en-US'. If your are looking for more options, you can take a look at '[window.REACT_INPUTS_VALIDATION](#custom-error-message)' section, which provides the extensibility for your own locale.**|**"en-US"** |
@@ -153,7 +153,7 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
153153
// locale: 'en-US', //Optional.[String].Default: "en-US". For error message display. Current options are ['zh-CN', 'en-US']; Default is 'en-US'. If your are looking for more options, you can take a look at 'window.REACT_INPUTS_VALIDATION' section, which provides the extensibility for your own locale.
154154
// msgOnError: "Your custom error message if you provide the validationOption['msgOnError']", //Optional.[String].Default: "" Show your custom error message no matter what(except the message from customFunc) when it has error if it is provied.
155155
// msgOnSuccess: "Your custom success message if you provide the validationOption['msgOnSuccess']. Otherwise, it will not show, not even green border.", //Optional.[String].Default: "". Show your custom success message no matter what when it has error if it is provied.
156-
// customFunc: res => { //Optional.[Func].Default: none. Custom function. Returns true or err message
156+
// customFunc: res => { //Optional.[Func].Default: none. Custom function. Returns true or err message or { error: true, message: 'message', showOnSuccess: true }
157157
// if (res != 'milk') {
158158
// return 'Description cannot be other things but milk';
159159
// }
@@ -500,7 +500,7 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
500500
|**validationOption.min** |**Opt**|**Num**|**Validation of min length.**|**0** |
501501
|**validationOption.max** |**Opt**|**Num**|**Validation of max length.**|**0** |
502502
|**validationOption.length** |**Opt**|**Num**|**Validation of exact length of the value.**|**0** |
503-
|**validationOption.customFunc** |**Opt**|**Func**|**Custom function. Returns true or err message.**| **none** |
503+
|**validationOption.customFunc** |**Opt**|**Func**|**Custom function. Returns true or err message or { error: true, message: 'message', showOnSuccess: true }.**| **none** |
504504
|**validationOption.reg** |**Opt**|**Bool**|**Custom regex.**|**""** |
505505
|**validationOption.regMsg** |**Opt**|**Str** |**Custom regex error message.**|**""** |
506506
|**validationOption.locale** |**Opt**|**Str** |**For error message display. Current options are ['zh-CN', 'en-US']; Default is 'en-US'. If your are looking for more options, you can take a look at '[window.REACT_INPUTS_VALIDATION](#custom-error-message)' section, which provides the extensibility for your own locale.**|**"en-US"** |
@@ -557,7 +557,7 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
557557
// regMsg: 'failed in reg.test(${value})', //Optional.[String].Default: "". Custom regex error message.
558558
// msgOnError: "Your custom error message if you provide the validationOption['msgOnError']", //Optional.[String].Default: "". Show your custom error message no matter what(except the message from customFunc) when it has error if it is provied.
559559
// msgOnSuccess: "Your custom success message if you provide the validationOption['msgOnSuccess']. Otherwise, it will not show, not even green border.", //Optional.[String].Default: "". Show your custom success message no matter what when it has error if it is provied.
560-
// customFunc: res => { //Optional.[Func].Default: none. Custom function. Returns true or err message
560+
// customFunc: res => { //Optional.[Func].Default: none. Custom function. Returns true or err message or { error: true, message: 'message', showOnSuccess: true }
561561
// if (res != 'banana') {
562562
// return 'Description cannot be other things but banana';
563563
// }

0 commit comments

Comments
 (0)