json-forms
json-forms copied to clipboard
Validation is not working if form is not filled
Hi , I am using brutusin:json-forms in my project to create form dynamically. But I have found one issue with validation. If form is empty then validation is not working for below json JSON Data=>
{
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"description": "Age in years",
"type": "integer",
"minimum": 0
}
},
"required": ["firstName", "lastName"]
}
Please help me to fix this issue.
if empty,the required fields are not okay,so it can't validate ?!? i didn't understood?
Validation is not working if no fields are filled in the form. the form is generated through above JSON schema in http://brutusin.org/json-forms/.
Hi,
Any Update ??
just happened it to me, fixed!
just find that line
if (parentObject[prop] !== null) {
replace with
if (parentObject[prop] == null) {
and it will work,
cheers!