Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Bug of reqiured item #108

Open
kwtsuiaa opened this issue Nov 23, 2017 · 2 comments
Open

Validation Bug of reqiured item #108

kwtsuiaa opened this issue Nov 23, 2017 · 2 comments

Comments

@kwtsuiaa
Copy link

kwtsuiaa commented Nov 23, 2017

I used the below schema to test in http://brutusin.org/json-forms/

{
    "type": "object",
    "properties": {"prop1": {"type": "string"}},
    "required": ["prop1"]
}

Found that prop1 cannot be validated. it don't return false if I don't fill anything.

@kwtsuiaa kwtsuiaa changed the title validate problem of nested item validate problem of reqiured item Nov 23, 2017
@kwtsuiaa kwtsuiaa changed the title validate problem of reqiured item Validation Bug of reqiured item Dec 4, 2017
@idelvall
Copy link
Member

@jc-src
Copy link

jc-src commented Jan 25, 2018

Hello, I was also checking out this required and I found out that:
1- If you do enter some data (focus) a field then validation works.
2- if you submit without enter in a field validation is skipied and "item" is not checked.

So: https://github.com/brutusin/json-forms/blob/master/dist/js/brutusin-json-forms.js#L985
line "delete schema.required;"
if that line is deleted the validation works fine.

I tried to to add to the "input" field required="required" as in theory it should work, but not.
Facts are, if you do enter some data but leave a field validation works. But if you just hit validate it do not work.
Soluction, comment/remove line 985 "delete schema.required"

I hope to have more time to investigate. It's a great lib, just found it) and perfect for my needs. Thanks a lot @idelvall
( Gracias!!! )

saicheck2233 added a commit to saicheck2233/json-forms that referenced this issue Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants