ulion / jsonform

Build forms from JSON Schema. Easily template-able. Compatible with Twitter Bootstrap out of the box.
http://ulion.github.io/jsonform/playground/
MIT License
49 stars 27 forks source link

ZSchema required? #26

Open mjau-mjau opened 8 years ago

mjau-mjau commented 8 years ago

I understand ZSchema-browser supposedly does some json-validation. However, I have disabled this JS file and I can't see any difference. The jsonform still validates successfully on submit. Is it an optional module? I am curious because it does after all weigh in at 80kb+.

ulion commented 8 years ago

then you may just skipped the json schema validation.

2015-10-31 13:31 GMT+08:00 Karl Ward notifications@github.com:

I understand ZSchema-browser supposedly does some json-validation. However, I have disabled this JS file and I can't see any difference. The jsonform still validates successfully on submit. Is it an optional module? I am curious because it does after all weigh in at 80kb+.

— Reply to this email directly or view it on GitHub https://github.com/ulion/jsonform/issues/26.

Ulion

ulion commented 8 years ago

you can use browser's develop console setup break point in formTree.prototype.validate function, then see how does it go when doing the validation.

2015-10-31 20:09 GMT+08:00 Ulion ulion2002@gmail.com:

then you may just skipped the json schema validation.

2015-10-31 13:31 GMT+08:00 Karl Ward notifications@github.com:

I understand ZSchema-browser supposedly does some json-validation. However, I have disabled this JS file and I can't see any difference. The jsonform still validates successfully on submit. Is it an optional module? I am curious because it does after all weigh in at 80kb+.

— Reply to this email directly or view it on GitHub https://github.com/ulion/jsonform/issues/26.

Ulion

Ulion

mjau-mjau commented 8 years ago

Excuse my ignorance, but doesn't jsonform generally validate with the following? ... or is there some zschema-specific implementation?

form_object.onSubmit = function (errors, values) {
  if(errors) {
    console.log('Errors');
    console.dir(errors);
  } else {
    console.log('Success');
    console.dir(values);
  }
}

Thanks for your efforts with jsonform btw.

ulion commented 8 years ago

no, jsonform does not do the validation work, but it will try to find loaded json schema validator to do that.

2015-11-01 13:36 GMT+08:00 Karl Ward notifications@github.com:

Excuse my ignorance, but doesn't jsonform generally validate with the following? ... or is there some zschema-specific implementation? form_object.onSubmit = function (errors, values) { if(errors) { console.log('Errors'); console.dir(errors); } else { console.log('Success'); console.dir(values); } }

Thanks for your efforts with jsonform btw.

— Reply to this email directly or view it on GitHub https://github.com/ulion/jsonform/issues/26#issuecomment-152795078.

Ulion