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
placeholder="Place your name here ^-^"// Optional.[String].Default: "".
362
+
validate={validate}// Optional.[Bool].Default: false. If you have a submit button and trying to validate all the inputs of your form at onece, toggle it to true, then it will validate the field and pass the result via the "validationCallback" you provide.
363
+
validationCallback={res=>this.setState({hasNameError: res,validate: false})}// Optional.[Func].Default: none. Return the validation result.
}}// Required.[Func].Default: () => {}. Will return the value.
374
+
onBlur={e=>{
375
+
console.log(e);
376
+
}}// Optional.[Func].Default: none. In order to validate the value on blur, you MUST provide a function, even if it is an empty function. Missing this, the validation on blur will not work.
// showMsg: true, // Optional.[Bool].Default: true. To determin display the error message or not.
385
+
// min: 2, // Optional.[Number].Default: 0. Validation of min length when validationOption['type'] is string, min amount when validationOption['type'] is number.
386
+
// max: 10, // Optional.[Number].Default: 0. Validation of max length when validationOption['type'] is string, max amount when validationOption['type'] is number.
387
+
// length: 2, // Optional.[Number].Default: 0. Validation of exact length of the value.
388
+
// compare: '3', // Optional.[String].Default: "" Compare this value to 3 to see if they are equal.
// locale: 'en-US', // Optional.[String].Default: "en-US". For error message display. Current options are ['zh-CN', 'en-US']; Default is 'en-US'.
392
+
// 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.
393
+
// 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.
394
+
// customFunc: res => { // Optional.[Func].Default: none. Custom function. Returns true or err message
395
+
// if (res != 'milk') {
396
+
// return 'Name cannot be other things but milk';
397
+
// }
398
+
// return true;
399
+
// }
400
+
}}
401
+
/>
354
402
<Radiobox
355
403
tabIndex={2}// Optional.[String or Number].Default: -1.
@@ -479,6 +527,60 @@ class Index extends React.Component<{}, State> {
479
527
// 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.
480
528
}}
481
529
/>
530
+
<Textarea
531
+
tabIndex="7"// Optional.[String or Number].Default: -1.
placeholder="Place your description here ^-^"// Optional.[String].Default: "".
537
+
validate={validate}// Optional.[Bool].Default: false. If you have a submit button and trying to validate all the inputs of your form at onece, toggle it to true, then it will validate the field and pass the result via the "validationCallback" you provide.
538
+
validationCallback={res=>
539
+
this.setState({
540
+
hasDescriptionError: res,
541
+
validate: false,
542
+
})
543
+
}// Optional.[Func].Default: none. Return the validation result.
}}// Required.[Func].Default: () => {}. Will return the value.
554
+
onBlur={e=>{
555
+
console.log(e);
556
+
}}// Optional.[Func].Default: none. In order to validate the value on blur, you MUST provide a function, even if it is an empty function. Missing this, the validation on blur will not work.
name: 'Description',// Optional.[String].Default: "". To display in the Error message. i.e Please enter your ${name}.
564
+
check: true,// Optional.[Bool].Default: true. To determin if you need to validate.
565
+
required: true,// Optional.[Bool].Default: true. To determin if it is a required field.
566
+
type: 'string',// Optional.[String].Default: "string". Validation type, options are ['string', 'number'].
567
+
// showMsg: true, // Optional.[Bool].Default: true. To determin display the error message or not.
568
+
// locale: 'en-US', // Optional.[String].Default: "en-US". For error message display. Current options are ['zh-CN', 'en-US']; Default is 'en-US'.
569
+
// min: 2, // Optional.[Number].Default: 0. Validation of min length when validationOption['type'] is string, min amount when validationOption['type'] is number.
570
+
// max: 10, // Optional.[Number].Default: 0. Validation of max length when validationOption['type'] is string, max amount when validationOption['type'] is number.
571
+
// length: 2, // Optional.[Number].Default: 0. Validation of exact length of the value.
// 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.
575
+
// 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.
576
+
// customFunc: res => { // Optional.[Func].Default: none. Custom function. Returns true or err message
577
+
// if (res != 'banana') {
578
+
// return 'Description cannot be other things but banana';
0 commit comments