1

I am using JQuery FormBuilder plugin to generate different form for organizational needs and let the employees to fill the forms as per requirement. For this purpose we use the JQuery Form Builder plugin

form-builder.js

and

form-render.js

We have created form building and form rendering modules.Now we could not figure out how to save the user input data back to DB. Is there any in-built way to get this done? I would prefer to store the user inputs in XML/JSON format, so that I could use that to render the filled form when user tries to edit or provide Save and Submit Later Functionality. Is it possible to achieve with this plug in ? Is there any hack to do that? It will be really helpful.

https://github.com/kevinchappell/formBuilder

tssutha
  • 99
  • 8

2 Answers2

2

it does not appear to be built into this plugin, but its built into jquery see this question

$('#form').serialize()
$('#form').serializeArray()
Community
  • 1
  • 1
CodeToad
  • 4,656
  • 6
  • 41
  • 53
0

you can now use the .userData method

from their documentation: https://formbuilder.online/docs/formRender/actions/userData/

var formRenderOptions = {
  formData: '[{"type":"text","label":"Text Field","name":"text-1526099104236","subtype":"text"}]';
}
var formRenderInstance = $('#render-container').formRender(formRenderOptions);
console.log(formRenderInstance.userData);
// "[{"type":"text","label":"Full Name","name":"text-1526099104236","subtype":"text","userData":["John Smith"]}]"
james
  • 601
  • 1
  • 7
  • 12