1.0.2 • Published 5 years ago

@geeknection/form-validation-js v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

geeknection/form-validation

React Jsx component used to auto-validation of form fields

Sem-t-tulo.png

Getting started

npm install @geeknection/form-validation-js --save

Usage

import FormValidation from '@geeknection/form-validation-js/dist';
    <FormValidation onSubmit={onSubmitForm}>
        <div style={{
            marginBottom: 10
        }}>
            <input
                style={{
                    padding: 10
                }}
                className='form-control input-name'
                name='name'
                placeholder='Nome'
                value={this.state.name}
                isrequired={true}
                onChange=(e) => this.setState({name: e.target.value})}/>
        </div>
        <button type='submit'>Enviar</button>
    </FormValidation>

Props


onSubmit

Used to submit your form. When your type your submit function, you doesn't need to use preventDefault and stopPropagation. FormValidation already do that.

TypeRequired
FunctionYes

isrequired

Used to say for FormValidation if element need is required

TypeRequired
booleanYes

className

All field need them own class.

TypeRequired
prototypeYes

Contributors

This module was extracted from React Js core. Please reffer to https://github.com/geeknection/form-validation/graphs/contributors for the complete list of contributors.

License

The library is released under the MIT licence. For more information see LICENSE.