Basic properties
Name | Description | Type |
---|---|---|
className | Name of class attribute assigned to the root form element | |
name | The name of the form | Optional |
config | Configuration options for the form. Read more | Optional |
data | Contains initial form data values when the form is loaded. Read more | Optional |
schema | JSON-based schema for rendering the form. Read more | Mandatory |
controls | Custom fields. Read more | Optional |
components | Custom template components mapped with schema using displayType property as template. Read more | Optional |
pageNumber | The default tab on opening the form (grouped form) | Optional |
lastPageNumber | The last page number will exclude any tabs that appear after the lastPageNumber tab | Optional |
onChange | A function that will be called whenever the value of a field changes. The second parameter provided to this function contains the complete form data. | Optional |
onError | A function that will be called whenever there is an error with a field. | Optional |
onNext | A function that will be called when when the user attempts to navigate to the next section of a grouped form. | Optional |
onPrevious | A function that will be called when when the user attempts to navigate to the previous section of a grouped form | Optional |
onSubmit | A function that will be called when the form is submitted | Mandatory |
changeResponseMode | Value: "form-data", "section-data", "default". form-data : onChange event will pass all the form data as a second parameter. section-data : onChange event will pass all the section data as a second parameter. | Optional |
nextResponseMode | Value: "form-data", "page-data" form-data : onNext event will send all the form data (onNext). page-data : onNext event will send all the date of the current page. Note : onNext is triggered on click of Next button | Optional |
onNext, onSubmit
It accepts the following three arguments:
- formData
- pageNumber
- setErrors
Return type of onNext, onSubmit
boolean
orPromise<boolean>
If return type is a Promise, the step will move forward only if the Promise response resolves to true.
formData
It is the form data in key/value pair.
pageNumber
For grouped forms, all the different form sections are paged from page number 1 to last page number. This argument returns the current page number of the section where onNext is called.
setErrors
It is a callback function which can be used for handling server side errors. Read more