How to insert a repeating field entry from another form

By: Henry King | Asked: 08/31/2023
ForumsCategory: General questionsHow to insert a repeating field entry from another form
Henry King asked 8 months ago
Hi   I've a multi-page form and I don't want data fields to be updated every time "NEXT" or "PREVIOUS" button is clicked. I only want data in certain fields to be updated when the form is UPDATED.   May I know which Formidable PHP hook can I use to update fields data when a form is UPDATED (not created or first submitted)?   Note: frm_entry_validate is not suitable because it runs every time NEXT or PREVIOUS button is pressed which is not the intention as it uses many resources unless there is a way to have it run      Thanks.   Henry
1 Answers
Victor Font answered 8 months ago
Data fields are not updated every time Next or Previous is clicked. When these buttons are clicked Formidable changes all fields not shown on a particular page into hidden fields. Only fields on the specific page are shown. Data updates occur when the final Submit is clicked. If you want to manipulate data after the submit button is clicked, use the frm_after_update_entry hook. https://formidableforms.com/knowledgebase/frm_after_update_entry/
Henry King replied 8 months ago

Hi, Thanks for your help.
for frm_after_update_entry, I would new the write the values of the fields that I wish to update to the database right?

I realize frm_pre_update_entry is executed every time the NEXT or PREVIOUS button is clicked based on log info. Is that correct?
I tried to use $_POST['item_meta'][$field_id] = $_SESSION['some_value'] then return $values but it didn't work as the values in the database didn't change. However the above code works when I use frm_validate_entry which is called each time the NEXT or PREVIOUS button is clicked.

In the ideal situation, I would rather use $_POST to manipulate the data when UPDATE button is clicked rather than having to manipulate the database. which hook will best achieve this without having this hook activated only when UPDATE/SUBMIT button is clicked and not NEXT or PREVIOUS button is clicked.

Thanks!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right