Dear Team,
I have .net core application where I implemented bpm form.js form-js
Now I want to add some custom components in the schema
Here is my working example:
<html>
<head>
<style>
body, html {
margin: 0;
padding: 0;
font-family: sans-serif;
}
#form {
max-width: 100%;
}
</style>
</head>
<body>
<div id="form"></div>
<button id="customButton">Custom Button</button>
<script type="application/form-schema">
{
"schemaVersion": 1,
"exporter": {
"name": "form-js",
"version": "0.1.0"
},
"type": "default"
}
</script>
<!--
required editor script
-->
<script>
document.getElementById('customButton').addEventListener('click', function ()
{
const schema = JSON.parse(
document.querySelector('[type="application/form-schema"]').textContent
);
const schemsa = formEditor.saveSchema(schema);
console.log('exported schema', schemsa);
});
const schema = JSON.parse(
document.querySelector('[type="application/form-schema"]').textContent
);
const container = document.querySelector('#form');
FormEditor.saveSchema({
container,
schema
});
</script>
</body>
</html>