Formik

    0

    1

    Hazrat Anas

    onInit:values => { this.onSubmit = this.onSubmit.bind(this); },

    onReset: values => { this.onInit = this.onInit.bind(this); }, }

    The onInit callback is invoked when the form data object instance is initially created. This callback is used to initialize the form data object. The onSubmit callback is invoked when the user clicks the "Submit" button. This button is bound to the onSubmit event. The onReset callback is invoked when the form data object is reset. This can be triggered by clicking the " Reset" button in the spinners, or by clicking the " Reset All" button in the main form.

    Library: react

    import { useFormik } from 'formik';
    import * as Yup from 'yup';
    
    initialValues: {
        position: formData.position,
        firstName: formData.firstName,
        lastName: formData.lastName,
        email: formData.email,
        password: formData.password,
        repeatPassword: formData.repeatPassword
      },
    
      validationSchema: Yup.object({
        position: Yup.string().required('Required'),
        firstName: Yup.string().required('Required'),
        lastName: Yup.string().required('Required'),
        email: Yup.string().required('Required'),
        password: Yup.string().required('Password is Required'),
        repeatPassword: Yup.string().oneOf([Yup.ref('password'), null], 'Passwords must match')
      }),
      onSubmit: values => {
        $(document).ready(function () {
          const name = $(".slide_button button")
          console.log(name[2])
          name[2].click()
          setformdata(values)
        });
    
    
      },
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.