Form field override - any examples out there?

default discord avatar
steveninety
last week
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


]


}


}


})

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!

    Star

    Connect with the Payload Community on Discord

    Discord

    online

    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.