kevinchappell / formBuilder

A jQuery plugin for drag and drop form creation
https://formbuilder.online
MIT License
2.61k stars 1.38k forks source link

Support loading output from formRender inc. userData into formBuilder #972

Open jokamax opened 5 years ago

jokamax commented 5 years ago

Description:

I use my forms in all directions :

  1. I create a form

  2. Save the form with : formBuilderInstance.actions.getData('json', true)

  3. Show it to the users : formBuilderInstance.formRender(formRenderOpts);

  4. Save complete form with : var content = JSON.stringify(formBuilderInstance.formRender('userData')); This contain ["Form" + "userData"] -> OK

  5. I give my users possibility to add/remove a field, then I use : formBuilder.actions.setData(content );

Problem : loading is workging BUT userData is totally lost

Is there a way to preserve userData inside the form "builder", even if it keep invisible or in a special field ?

Environment Details:

lucasnetau commented 1 year ago

This isn't a supported use case

userData is only used by formRender. For text inputs you could map the userData back to the value attribute however for select/checkbox/radio you would need to map the selected state back to the options array.