forms icon indicating copy to clipboard operation
forms copied to clipboard

JSON pretty Stringify

Open sivatumma opened this issue 10 years ago • 3 comments

Request a JSON.stringify({},null,'\t') kind of output through this. Which means the form created through our forms.create({}) should be displayed just like pretty json and on click on any form field, they must be editable.

sivatumma avatar Feb 11 '15 07:02 sivatumma

Can you elaborate? I have no idea what you're asking for here.

ljharb avatar Feb 11 '15 08:02 ljharb

Okay I will explain. (I hope I am in a right codebase). Right now I observe that this json-to-html-form creation happens pretty well and we can have form handler on it. What I wish I could have in addition is imagine how a JSON.stringify({"key":"value"},null,'\t') will print a pretty formatted json. In the same way the form being output to html from this library be just like that with form elements placed inline. It will look like a JSON tree structure in HTML UI. I have tried doing forms.create(JSON.stringify({"key":"value"},null,'\t')) but failed as it is expecting perfect JSON there.

sivatumma avatar Feb 11 '15 08:02 sivatumma

This module isn't for JSON-to-form creation - it's for JS-to-form creation. There's no JSON anywhere - JSON is a string, and once it's parsed, it's not JSON anymore.

ljharb avatar Feb 11 '15 09:02 ljharb