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

141
Views
Overwrite Values react-hook-form

I have a form that conditionally displays inputs.

What I have to do is display a table with values taken from a search of a database which is in a form. I have this part down, but the problem is saving it. I have to use react-hook-form getValues() to get the values of the form, including what is displayed on the table. To do this, I created hidden inputs with default values of what I need to save. This part works, but the problem occurs when the condition is no longer met, for some reason it still has the values of these inputs saved even though they should not exist.

Ex/

condition ? (
<Controller 
  controllerstuff....
  <input value="tabledata" hidden/>
/>
) : (
<Controller 
 controllerstuff...
 <input value="overwrite other stuff" hidden/>
/>
)

So, how can I overwrite/remove these values I do not need or what would be the best way to save the values from the search using getValues()? Thanks in advance.

about 4 years ago · Juan Pablo Isaza
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!