Is there a way to pass formik form values from a child component to a parent component and handle form submission in parent component only. I have a use case where I'm building a form for restaurant. The form will have many many fields. So I grou...
Is there a yup function that validates a specific length?   I tried .min(5) and .max(5), but I want something that ensures the number is exactly 5 characters (ie, zip code)....
I'm using Yup to validate a signup form but I'm struggling to validate the credit card fields due to needing methods from both Yup's string and number schema.  Card number for example should not exceed 16 characters. This is easily achiev...
I'm trying to use Yup along with Formik in my react form. The form fields are going to be dynamic so as their validations.   export const formData = [   {     id: "name",     label: "Full name",     placeholder: "Enter full na...
I have nested fields with number inputs and can't get the validation to work properly. Not sure if this is a problem with formik or yup / how the validation schema is declared but I'll start asking here.  In the example I have two fields whic...
I've got a form with some text inputs, and some custom components. I've got the Formik validation working on the text inputs but not the custom components. I am now trying to add Formik validation to my custom categoriesMultiselect component....
I have several fields that are required if a single condition is true.  Is there a better way to condense this code to avoid repeating the when for all of these fields?  const requiredForDiffAddress = {     is: false,     then: Yup.string().required(...
How to implement the condition like value of 1 field should always be greater than the value of another field.  here's my schema     value: Yup.number().required(''),    value2: Yup.number().when('value',{      is: (val) => som...
I'm playing around with formik and yup in react and I was wondering what is the best way to go about doing a redirect after a successful request?   I tried passing in the history object but it gave me an error saying that it was global:  const Si...
I want to make sure users don't fill in their username (pattern is a upercase or lowercase u, followed by 7-10 digits: U0000000)  In the following example, the regex itself does work. However in conjunction with the .matches() method it does not...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.