0

enter image description here

I need to build a form using react hook form where user can add multiple dates and a particular dates can have any number of events

My form code is


  const { control, setValue, getValues } = useForm<any>({
    defaultValues: {
      date: [],
      selectedDate: null,
      selectedEvent: null,
      eventName: '',
      bookingPerson: '',
      timeIn: '',
      noOfPeople: null,
      fPreferences: [],
      beverages: [],
    },
  });

I have made controlled input components and all other components like this using Controller API of react hook form.

<InputField
control={control}
formKey={`eventName`}
label="Event Name"
placeholder="Enter Event Name"
/>

How can i achieve this where user can add more dates and events in the form.

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.