Skip to content

Commit 6da4d4f

Browse files
author
Edward Xiao
authored
Update README.md
1 parent 639e6be commit 6da4d4f

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

README.md

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ Tested on IE9+ and Chrome and Safari(10.0.3)
100100
|~~**validationOption.phoneCountry**~~|~~**Opt**~~|~~**Str**~~|~~**Useful when the validationOption['type'] is phone. Check if the phone number matchs en-US phone number format.**~~ <br><br>**No longer support after v1.4.0. For phone or email address validation please reffer to '[Phone and email validation example](#phone-email-validation-example)'**|~~**"en-US"**~~|
101101
|**validationOption.msgOnError** |**Opt**|**Str** |**Show your custom error message no matter what(except the message from customFunc) when it has error if it is provied.**|**""** |
102102
|**validationOption.msgOnSuccess** |**Opt**|**Str** |**Show your custom success message no matter what when it has error if it is provied.**|**""** |
103+
|**asyncMsgObj.error** |**Opt**|**Bool** |**(Server response) Backend validation result.**|**false** |
104+
|**asyncMsgObj.message** |**Opt**|**Str** |**(Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'**|**""** |
105+
|**asyncMsgObj.showOnError** |**Opt**|**Bool** |**(Server response) Show AJAX error message or not.**|**true** |
106+
|**asyncMsgObj.showOnSuccess** |**Opt**|**Bool** |**(Server response) Show AJAX success message or not.**|**false** |
103107

104108

105109
```js
@@ -154,11 +158,18 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
154158
// return true;
155159
// }
156160
}}
161+
// asyncMsgObj={{
162+
// error: false, // Optional.[Bool].Default: false. (Server response) Backend validation result.
163+
// message: '', // Optional.[String].Default: "". (Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'
164+
// showOnError: true, // Optional.[Bool].Default: true. (Server response) Show AJAX error message or not.
165+
// showOnSuccess: false, // Optional.[Bool].Default: false. (Server response) Show AJAX success message or not.
166+
// }}
157167
/>
158168
```
159169

160170

161171

172+
162173
### <a name="Radiobox"></a>Radiobox
163174

164175
|Props | |Type |Description |Default |
@@ -191,6 +202,10 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
191202
|**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"** |
192203
|**validationOption.msgOnError** |**Opt**|**Str** |**Show your custom error message no matter what when it has error if it is provied.**|**""** |
193204
|**validationOption.msgOnSuccess** |**Opt**|**Str** |**Show your custom success message no matter what when it has error if it is provied.**|**""** |
205+
|**asyncMsgObj.error** |**Opt**|**Bool** |**(Server response) Backend validation result.**|**false** |
206+
|**asyncMsgObj.message** |**Opt**|**Str** |**(Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'**|**""** |
207+
|**asyncMsgObj.showOnError** |**Opt**|**Bool** |**(Server response) Show AJAX error message or not.**|**true** |
208+
|**asyncMsgObj.showOnSuccess** |**Opt**|**Bool** |**(Server response) Show AJAX success message or not.**|**false** |
194209

195210
```js
196211
import { Radiobox } from 'react-inputs-validation';
@@ -233,14 +248,18 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
233248
// msgOnError: "Your custom error message if you provide the validationOption['msgOnError']", //Optional.[String].Default: "". Show your custom error message no matter what when it has error if it is provied.
234249
// 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.
235250
}}
251+
// asyncMsgObj={{
252+
// error: false, // Optional.[Bool].Default: false. (Server response) Backend validation result.
253+
// message: '', // Optional.[String].Default: "". (Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'
254+
// showOnError: true, // Optional.[Bool].Default: true. (Server response) Show AJAX error message or not.
255+
// showOnSuccess: false, // Optional.[Bool].Default: false. (Server response) Show AJAX success message or not.
256+
// }}
236257
/>
237258
```
238259

239260

240261

241262

242-
243-
244263
### <a name="Checkbox"></a>Checkbox
245264

246265

@@ -273,6 +292,11 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
273292
|**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"** |
274293
|**validationOption.msgOnError** |**Opt**|**Str** |**Show your custom error message no matter what when it has error if it is provied.**|**""** |
275294
|**validationOption.msgOnSuccess** |**Opt**|**Str** |**Show your custom success message no matter what when it has error if it is provied.**|**""** |
295+
|**asyncMsgObj.error** |**Opt**|**Bool** |**(Server response) Backend validation result.**|**false** |
296+
|**asyncMsgObj.message** |**Opt**|**Str** |**(Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'**|**""** |
297+
|**asyncMsgObj.showOnError** |**Opt**|**Bool** |**(Server response) Show AJAX error message or not.**|**true** |
298+
|**asyncMsgObj.showOnSuccess** |**Opt**|**Bool** |**(Server response) Show AJAX success message or not.**|**false** |
299+
276300
```js
277301
import { Checkbox } from 'react-inputs-validation';
278302
import 'react-inputs-validation/lib/react-inputs-validation.min.css';
@@ -317,6 +341,12 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
317341
// msgOnError: "Your custom error message if you provide the validationOption['msgOnError']", //Optional.[String].Default: "". Show your custom error message no matter what when it has error if it is provied.
318342
// 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.
319343
}}
344+
// asyncMsgObj={{
345+
// error: false, // Optional.[Bool].Default: false. (Server response) Backend validation result.
346+
// message: '', // Optional.[String].Default: "". (Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'
347+
// showOnError: true, // Optional.[Bool].Default: true. (Server response) Show AJAX error message or not.
348+
// showOnSuccess: false, // Optional.[Bool].Default: false. (Server response) Show AJAX success message or not.
349+
// }}
320350
/>
321351
```
322352
@@ -360,7 +390,10 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
360390
|**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"** |
361391
|**validationOption.msgOnError** |**Opt**|**Str** |**Show your custom error message no matter what when it has error if it is provied.**|**""** |
362392
|**validationOption.msgOnSuccess** |**Opt**|**Str** |**Show your custom success message no matter what when it has error if it is provied.**|**""** |
363-
393+
|**asyncMsgObj.error** |**Opt**|**Bool** |**(Server response) Backend validation result.**|**false** |
394+
|**asyncMsgObj.message** |**Opt**|**Str** |**(Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'**|**""** |
395+
|**asyncMsgObj.showOnError** |**Opt**|**Bool** |**(Server response) Show AJAX error message or not.**|**true** |
396+
|**asyncMsgObj.showOnSuccess** |**Opt**|**Bool** |**(Server response) Show AJAX success message or not.**|**false** |
364397
365398
```js
366399
import { Select } from 'react-inputs-validation';
@@ -417,13 +450,18 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
417450
// msgOnError: "Your custom error message if you provide the validationOption['msgOnError']", //Optional.[String].Default: "". Show your custom error message no matter what when it has error if it is provied.
418451
// 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.
419452
}}
453+
// asyncMsgObj={{
454+
// error: false, // Optional.[Bool].Default: false. (Server response) Backend validation result.
455+
// message: '', // Optional.[String].Default: "". (Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'
456+
// showOnError: true, // Optional.[Bool].Default: true. (Server response) Show AJAX error message or not.
457+
// showOnSuccess: false, // Optional.[Bool].Default: false. (Server response) Show AJAX success message or not.
458+
// }}
420459
/>
421460
```
422461
423462
424463
425464
426-
427465
### <a name="Textarea"></a>Textarea
428466
429467
|Props | |Type |Description |Default |
@@ -466,6 +504,10 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
466504
|**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"** |
467505
|**validationOption.msgOnError** |**Opt**|**Str** |**Show your custom error message no matter what(except the message from customFunc) when it has error if it is provied.**|**""** |
468506
|**validationOption.msgOnSuccess** |**Opt**|**Str** |**Show your custom success message no matter what when it has error if it is provied.**|**""** |
507+
|**asyncMsgObj.error** |**Opt**|**Bool** |**(Server response) Backend validation result.**|**false** |
508+
|**asyncMsgObj.message** |**Opt**|**Str** |**(Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'**|**""** |
509+
|**asyncMsgObj.showOnError** |**Opt**|**Bool** |**(Server response) Show AJAX error message or not.**|**true** |
510+
|**asyncMsgObj.showOnSuccess** |**Opt**|**Bool** |**(Server response) Show AJAX success message or not.**|**false** |
469511
470512
```js
471513
import { Textarea } from 'react-inputs-validation';
@@ -520,6 +562,12 @@ import 'react-inputs-validation/lib/react-inputs-validation.min.css';
520562
// return true;
521563
// }
522564
}}
565+
// asyncMsgObj={{
566+
// error: false, // Optional.[Bool].Default: false. (Server response) Backend validation result.
567+
// message: '', // Optional.[String].Default: "". (Server response) Your AJAX message. For instance, provide it when backend returns 'USERNAME ALREADY EXIST'
568+
// showOnError: true, // Optional.[Bool].Default: true. (Server response) Show AJAX error message or not.
569+
// showOnSuccess: false, // Optional.[Bool].Default: false. (Server response) Show AJAX success message or not.
570+
// }}
523571
/>
524572
```
525573

0 commit comments

Comments
 (0)