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

Question: how to create a sub form type functionality and go back to main form #7

Closed ikeamanual closed 9 years ago

ikeamanual commented 9 years ago

Hi,

This is not really a Jsonform question, but a Javascript question about using forms ...

I have a jsonform custom select field with a datalist. If the user enters a unknown value, I want to present a new form so that he can enter more information about the new value.

I have created the new page with a new seperate Jsonform in newStoreForm.html. When the user enters an unkown value I do:

window.location = "newStoreForm.html";

In the onSubmit() of the newStoreForm I do:

window.history.back(); return false;

I go back but all my previous info is gone and the original page is reloaded... (By the way, I am running all this locally without a server in node-webkit http://nwjs.io/.)

Is there a way to achieve this functionality without manually storing the whole state of the main page and rebuilding it manually?

Maybe use the newStoreForm jsonform in jquery Dialog? Any examples?

thanks,

Peter

ulion commented 9 years ago

use modal dialog.

2015-03-14 21:06 GMT+08:00 ikeamanual notifications@github.com:

Hi,

This is not really a Jsonform question, but a Javascript question about using forms ...

I have a jsonform custom select field with a datalist. If the user enters a unknown value, I want to present a new form so that he can enter more information about the new value.

I have created the new page with a new seperate Jsonform in newStoreForm.html. When the user enters an unkown value I do:

window.location = "newStoreForm.html";

In the onSubmit() of the newStoreForm I do:

window.history.back(); return false;

I go back but all my previous info is gone and the original page is reloaded... (By the way, I am running all this locally without a server in node-webkit http://nwjs.io/.)

Is there a way to achieve this functionality without manually storing the whole state of the main page and rebuilding it manually?

Maybe use the newStoreForm jsonform in jquery Dialog? Any examples?

thanks,

Peter

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

Ulion