Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
Formik hidden field not showing up on submit and a way to set initial values dynamically

I'm using formik ArrayFields to generate a set of questions based on user input.

<Field
    type="hidden"
    value={something.text}
    name={`friends[${index}].something`}
/>
<Field
   type="hidden"
   value={something.type}
   name={`friends[${index}].type`}
/>
<Field
   className={classes.textField}
   component={TextField}
   label={something.text}
   value=" "
   name={`friends[${index}].somethinelse`}
/>

on submit I want the hidden fields to show as {name:value} how would I do that as that is currently not how they work. Also I would like a way to have a default value for my fields to submit as if they are untouched at the moment having a value = " " does not allow me to edit the field; onChange = "formik.handleChange" does not work as well, on change returns as undefined will post the exact error if someone is interested. thanks for any help

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I fixed this by populating the formik values before rendering the fields with dummy data

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!