Reputation: 19
I created form using Form.io in MVC. Now I want to edit the created form how can I do that. I have HTML of the created form. If someone kindly assist me in it. I am new to Form.io. And I really need to edit form my code is posted below.
Formio.builder(document.getElementById('builder'), {}, {
builder: {
basic: false
customBasic: {
title: 'Basic Components',
default: true,
weight: 0,
components: {
textfield: true,
textarea: true,
email: true
}
}
layout: {
components: {
table: false
}
}
}
}).then(function (form) {
$("#saveForm").on('click', function (submission) {
var id = document.querySelector('[id^=builder-element-]').id
var content = $(".formarea:eq(0)>div");
var finalHtml = "";
$.each(content, function (value, index) {
var el = $(index);
finalHtml += el.html();
})
// ajax call to save html
});
Upvotes: 0
Views: 987
Reputation: 918
The documentation can be found here
Formio.builder(element, [form], [options])
A fiddle to demo the above usage.
I am re-creating the form builder interface with JSON schema of a saved form.
Upvotes: 0
Reputation: 11
The interface for this particular library is not documented very well in the Formio docs. The second parameter passed to Form.builder()
is the JSON schema of the form you want to edit.
Upvotes: 1