Entry Editing Hook

By: stephen siegel | Asked: 10/07/2022
ForumsCategory: General questionsEntry Editing Hook
stephen siegel asked 2 years ago
Under certain programmatic circumstances I would like to prevent users from making any further edits to an existing entry.
The frm_user_can_edit seems appropriate, but apparently this hook also prevents the user from even viewing the entry. The desired functionality is that the user should see the contents of the entry on frm_action=edit, yet they shouldn't be able to submit.
This can be achieved easily with CSS yet this measure is easily circumvented by a savvy user.
1 Answers
Rob LeVineRob LeVine answered 2 years ago
Try the first example here - https://formidableforms.com/knowledgebase/frm_setup_edit_fields_vars/#kb-examples If you want the entire form to be uneditable, instead of using each individual filed id, you can use $field->form_id to compare to the form id in question and make all those fields read-only.
stephen siegel replied 2 years ago

This is a very elegant solution, but unfortunately it merely adds a readonly property to the fields. This can be circumvented easily with DOM manipulation by simply removing the property from the fields in devtools.

I believe the only secure solution for preventing entry editing would be a server-side one.

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