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
* <ahref="https://codesandbox.io/s/custom-function-further-control-when-providing-customfunc-yjwch">Custom function further control</a>(when providing ```customFunc```)
30
30
* <ahref="https://codesandbox.io/s/q9vqmk4j84">Example of custom locales</a>(when providing ```window.REACT_INPUTS_VALIDATION['customErrorMessage']```)
31
31
* <ahref="https://codesandbox.io/s/13qo2rqxjj">Example of phone and email validation</a>(handled with ```customFunc```)
32
-
* <ahref="https://codesandbox.io/s/async-checking-via-customfunc-emqgw">Example of checking username existence (suggest not using asyncMsgObj) </a>(handled with ```customFunc```)
32
+
* <ahref="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```)
33
33
* <ahref="https://codesandbox.io/s/asyncmsgobj-blmce">Example of asyncMsgObj </a>(when providing ```asyncMsgObj```)
34
34
35
35
# Docs Link
@@ -95,7 +95,7 @@ Tested on IE9+ and Chrome and Safari(10.0.3)
95
95
|**validationOption.max**|**Opt**|**Num**|**Validation of max length when validationOption['type'] is string, max amount when validationOption['type'] is number.**|**0**|
96
96
|**validationOption.length**|**Opt**|**Num**|**Validation of exact length of the value.**|**0**|
97
97
|**validationOption.compare**|**Opt**|**Str**|**Compare this value to 3 to see if they are equal.**|**""**|
98
-
|**<aname="customFunc"></a>validationOption.customFunc**|**Opt**|**Func**|**Custom function. Returns true or err message.**|**none**|
98
+
|**<aname="customFunc"></a>validationOption.customFunc**|**Opt**|**Func**|**Custom function. Returns true or err message or { error: true, message: 'message', showOnSuccess: true }.**|**none**|
|**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"**|
// 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.
154
154
// 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.
155
155
// 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 }
157
157
// if (res != 'milk') {
158
158
// return 'Description cannot be other things but milk';
|**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"** |
// 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.
559
559
// 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 }
561
561
// if (res != 'banana') {
562
562
// return 'Description cannot be other things but banana';
0 commit comments