skip

Specification

Controls whether to exclude a field during the serialization.
Skipping a field doesn't affect its other behavior (i.e. validation).

Definition

1
type Skip = boolean
Copied!
Default value: false

Example

1
import React from 'react'
2
import { Form } from 'react-advanced-form'
3
import { Input } from 'react-advanced-form-addons'
4
5
export default class Example extends React.Component {
6
handleFormSubmit = ({ serialized }) => {
7
console.log(serialized) // { "username": "admin", "password": "123" }
8
}
9
10
render() {
11
return (
12
<Form action={this.handleFormSubmit}>
13
<Input
14
name="username"
15
value="admin"
16
required />
17
<Input
18
name="password"
19
type="password"
20
value="123"
21
required />
22
<Input
23
name="confirmPassword"
24
type="password"
25
value="123"
26
required
27
skip />
28
</Form>
29
)
30
}
31
}
Copied!
Last modified 3yr ago