Disable editing (read-only) previously saved entry repeater fields

By: Paul Lubking | Asked: 07/11/2024
ForumsCategory: Code HelpDisable editing (read-only) previously saved entry repeater fields
Paul Lubking asked 2 months ago
Hi, I want to disable the possibility to edit previously saved repeater fields when editing an existing form entry. So only adding a new repeater section with new values should be allowed/possible, the previously submitted values have to be read only or unable to edit. I tried various codes and combining them to no avail. Anyone here know how to achieve this maybe? With php or Ajax.. doesn't really matter, as long as it works. Thanks in advance!
1 Answers
Victor Font answered 2 months ago
There are a few ways you can handle this with hooks, but there may be a much easier way to just handle it in the browser on page load with jQuery. After the page loads, loop through all the existing populated rows and disable the inputs. That's all a hook would do anyway, except the hook would fire before the page is rendered, the jQuery fires after the page is rendered. I think it would be easier to implement the jQuery when using repeaters. When using jQuery with Formidable the script goes in the After Fields section on the form's Customize HTML page.
Paul Lubking replied 2 months ago

Sounds good Victor, thanks.
But I'm no jQuery expert at all, any chance there's an example of this maybe?

Victor Font replied 2 months ago

None that I know of and I don't have time to create an example for you. I'm tagging @Rob LeVine on this response. If he has the availability and knows how to do this, I'm sure he'd at least be willing to take a look. If not, you'll have to Google for an answer unless someone else can jump in on this thread and receive the pass.

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