Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Form field override - any examples out there?

default discord avatar
steveninety2 years ago
1

I am trying to override fields in the form collection from the form builder plugin. Could anyone demonstrate a working example of field overrides? See

https://github.com/payloadcms/plugin-form-builder#field-overrides

. I copied the example and the label changes, but no success adding in custom fields/blocks... Nothing shows up. Is there a maybe a public repo that implements field overrides?



Any ideas or help would be appreciated 🙂



Oh well, I've got it working... I should look into the source code sooner...



Example of how to add fields to the Text form fields:



import { fields } from "@payloadcms/plugin-form-builder"



In the plugin config:



FormBuilder({


fields: {


text: {


fields: [


{


name: "myCustomField",


type: "text"


},


...fields.text.fields


]


}


}


})

    Star on GitHub

    Star

    Chat on Discord

    Discord

    online

    Can't find what you're looking for?

    Get dedicated engineering support directly from the Payload team.