onSubmitStart

Specification

Called immediately on the submit attempt of the valid form. Useful for displaying a loader in the interface, acknowledging the user that the submit action is in progress.

Definition

1
type OnSubmitStart = ({
2
serialized: Object, // Serialized fields
3
fields: Object, // The state of the fields
4
form: ReactComponent // Reference to the Form component
5
}) => void
Copied!

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
handleSubmitStart = ({ serialized, fields, form }) => {
7
// ...
8
}
9
10
render() {
11
return (
12
<Form onSubmitStart={this.handleSubmitStart}>
13
<Input name="username" required />
14
<button type="submit">Submit</button>
15
</Form>
16
)
17
}
18
}
Copied!
Last modified 3yr ago