Charts and Console(5)Validation Form
Follow the document, it is pretty straightforward.
ValidateForm.js some other validations can be added here as well.
export const required = value => value ? undefined : 'Required';
export const maxLength = max => value =>
value && value.length > max ? `Must be ${max} characters or less` : undefined;
export const minLength = min => value =>
value && value.length < min ? `Must be ${min} charactors or more` : undefined;
export const number = value => value && isNaN(Number(value)) ? 'Must be a number' : undefined;
export const minValue = min => value =>
value && value < min ? `Must be at least ${min}` : undefined;
export const maxValue = max => value =>
value && max < value ? `Must be less than ${max}` : undefined;
export const email = value =>
value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value) ?
'Invalid email address' : undefined;
Import the validations to the form
import {required, minLength, minValue} from '../common/ValidationForm';
Add that to the Field
<Field
type="text"
name="company"
label="Company"
placeholder="Company Name for Search(eg. walmart)"
validate={[ required, minLength(3) ]}
component={FieldInput}
/>
<Field
type="text"
name="interval"
label="Interval"
placeholder="Interval for Search unit minutes (eg. 70)"
validate={[ required, minValue(70) ]}
component={FieldInput}
/>
References:
https://learnetto.com/blog/how-to-do-simple-form-validation-in-reactjs
https://redux-form.com/6.6.1/examples/fieldlevelvalidation/
分享到:
相关推荐
实用c#图形编程指南 Practical C# Charts and Graphics
Practical C#Charts.and.Graphics
可自定义条形图 -可自定义折线图 -可自定义饼图 -X和Y轴标签自定义 -X和Y轴线自定义 -多个数据集可用.....等
非常好的WPF的图形方面的书, 强烈推荐不可多得得好书
Excel 2007 Charts Made Easy shows you how to upgrade from simple pie and bar charts to rich data visualization using the full range of charts available in the latest version of the software....
A good visualization can communicate the nature and potential impact of information and ideas more powerfully than any other form of communication. For a long time dataviz” was left to specialists...
NEW CHARTS AND NAUTICAL DOCUMENTS,电子海图,S57,相关标准 更多资源请访问http://www.59186618.com
Axhub Charts Pro V2.1.1.rplib Axhub Charts Pro V2.1.1.rplib Axhub Charts Pro V2.1.1.rplib Axhub Charts Pro V2.1.1.rplib Axhub Charts Pro V2.1.1.rplib Axhub Charts Pro V2.1.1.rplib Axhub Charts Pro V...
图书名称:The Truthful Art: Data, Charts, and Maps for Communication 作者:Alberto Cairo 出版社:New Riders 页数:154 出版时间:2016 语言:English 格式:EPUB 内容简介: No matter what your actual ...
WPFVisifire.Charts 5.0 开发demo,支持柱状图、折线图、仪表盘等图表。
Create all kinds of charts using the latest technologies available on browsers HTML5 CSS3 jQuery jqPlot D3 Highcharts and SVG Full of step by step examples Beginning JavaScript Charts introduces you ...
wpf charts源码,D源码,图书:practical-wpf-charts-graphics-master
Next, you will be introduced to Qt 5 chart which allows you to easily render different types of graphs and charts and incorporate List View Widgets in your application. You will also work with ...
vba code for manage graph charts and management. including freeze charts object
Awesome Charts是一个库,旨在帮助构建美丽的图表毫不费力。主要目标是为构建UI画布图表提供所有必要的类,这些类很容易自定义,不需要大量的设置时间。当前版本的库支持LineChart, BarChart和PieChart。
Live-Charts-master.zip LiveCharts2-master.zip
Create Web Charts with D3 shows how to convert your data into eye-catching, innovative, animated, and highly interactive browser-based charts. This book is suitable for developers of all experience ...