JMap.Form.getPreparedData
This function prepare the data, it returns a copy object containing the values formatted in a way that fit the server needs.
It's not mandatory to use this function but it's highly recommended to use it before :
It returns another object without modifing the passed object.
Use to set the correct type (number if a string number is passed), and many other things.
A JMap form's metadata
The form data
the prepared data
const data = ...const form = ...const preparedData = JMap.Form.getPreparedData(form, data)const errors = JMap.Form.validateData(form, preparedData) Copy
const data = ...const form = ...const preparedData = JMap.Form.getPreparedData(form, data)const errors = JMap.Form.validateData(form, preparedData)
JMap.Form.getPreparedData
This function prepare the data, it returns a copy object containing the values formatted in a way that fit the server needs.
It's not mandatory to use this function but it's highly recommended to use it before :
It returns another object without modifing the passed object.
Use to set the correct type (number if a string number is passed), and many other things.