2

How can I configure below "Form builder js" in Magento 2.3.0 custom extension?

https://github.com/dobtco/formbuilder

I want to use this js in my custom Extension's form in the admin side.

1 Answer 1

1

Please try following way to add JS in admin:

Create file app/code/Vendor/Module/view/adminhtml/layout/adminhtml_system_config_edit.xml or add following code for JS in your custom module's admin layout XML

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Vendor_ModuleName::js/formbuilder.js"/>
    </head>
</page>

You can put your formbuilder.js in following path.

app/code/Vendor/Module/view/adminhtml/web/js/formbuilder.js

Please check and let me know if any issue.

7
  • 1
    Thanks for your answer but what if I want to add in form rather than the system config ? Commented Feb 11, 2019 at 5:29
  • yes you can add this code in your form's layout.xml file Commented Feb 11, 2019 at 5:30
  • please share me your form's layout file so I will guide you how to add. Commented Feb 11, 2019 at 5:30
  • 1
    I want the same form as you can see in this screenshot :screencast.com/t/881sEzsmT Commented Feb 11, 2019 at 5:44
  • 1
    Yes, and I have added js and CSS in form layout file as you described. Plz help me I will accept your answer also upvote. Commented Feb 11, 2019 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.