Skip to content

Linking field values #397

Answered by jmikrut
slavanossar asked this question in Q&A
Dec 18, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hey @slavanossar — this is absolutely possible. You're right in that you can use collection hooks to modify field values on the server-side, on save, but for your case, you're likely to benefit more from client-side component-based implementation.

Yep - custom components are the way to go. Something like this:

import React, { useEffect } from 'react';
// You can import the text input on its own if you have payload@0.13.8-beta.0
import { TextInput, useWatchForm, useField } from 'payload/components/forms';

const CustomTextInput = ({ name, path, label }) => {

  // This will be documented more fully once we have the API solidified
  // But for now, you can take a look at Payload's source co…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@slavanossar
Comment options

@jmikrut
Comment options

Answer selected by slavanossar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants