Skip to content

Latest commit

 

History

History
44 lines (41 loc) · 1.59 KB

File metadata and controls

44 lines (41 loc) · 1.59 KB

formbuilder

Generate Form Creation Drag and Drop With Javascript Demo

How to use

buildform([FORM ID], [JSON DATA], [LANG]);

Example

<form id="formbuilder" method="post" action=""></form>
<script>
const form = {
                "title" : "Judul Formulir",
                "description" : "Deskripsi Formulir",
                "form" : [
                            {
                              "type" : "text",
                              "question" : "Nama",
                              "description" : "Isi dengan nama lengkap",
                              "required" : true,
                              "data":[]
                            },
                            {
                              "type" : "select",
                              "question" : "Kelamin",
                              "description" : "",
                              "required" : true,
                              "data" : [
                                          "Laki - laki",
                                          "Perempuan"
                                      ]
                            }
                          ]
              };

buildform("formbuilder", form, "id");
</script>

Add form

let formjson = {
                  "type" : "text",
                  "question" : "Telepon",
                  "description" : "Isi dengan nomor telepon",
                  "required" : false,
                  "data":[]
                },
  
formbuilder_add("formbuilder", formjson, "id");