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.

Is there a way to add a form field to a link using Form Builder plugin

default discord avatar
christopher.nowlan2 years ago
3

I am trying to add a form field to link within the emails section

  • discord user avatar
    jacobsfletch
    2 years ago

    Use the

    formOverrides

    property in your plugin config to add a

    link

    field to your forms. This will allow you to insert links into any of your forms that scroll to the other sections of your form using hash urls. These point to DOM elements on the page with a matching

    id

    attribute. Something like this:



    formBuilder({
      formOverrides: {
        fields: [
          {
            name: 'link',
            type: 'group',
            fields: [
              {
                name: 'label',
                type: 'text',
                required: true,
              },
              {
                name: 'url',
                type: 'text',
                required: true,
              },
            ],
          },
        ],
      },
    })
  • default discord avatar
    christopher.nowlan2 years ago
    @808734492645785600

    I dont think I quite worded the question correctly I want the email field to be a link



    eg results pdf link url is from a form field

  • discord user avatar
    jacobsfletch
    2 years ago

    Oh I see. Ok that being rich text, you'd probably need to add a custom leaf that can format the link element you see rendered there. Otherwise you could use your own bracket-like syntax and parse it yourself before sending your emails. Something like this

    [Download PDF]({{url}})

    (markdown inspired).

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.