How does Edit Entry handle hidden fields and field visibility settings?
If Edit Entry fields are configured
Edit Entry will show all the fields that are added to the configuration, including Hidden fields and fields that have different Visibility settings ( learn more about the Visibility setting on Gravity Forms' help site).
You can limit what users see each field in Edit Entry by configuring the field to only show for certain user roles. Learn how to limit fields by role.
If Edit Entry fields are not configured
When Edit Entry fields are not configured, the form will show all form fields by default.
Hidden field type
If the form has a Hidden Field, the Hidden field will be included in the Edit Entry form's HTML output. The value of the field will also be included in the output but will not be visible to the eye.
Note: The value of Hidden Field fields are visible and editable if a user is tech-savvy.
To prevent a user from being able to see and edit Hidden Field values:
- Configure the fields that are displayed in the Edit Entry form
- Use a Text field instead, and modify the Visibility settings in the Advanced tab of the Field in Gravity Forms
- Use code to prevent Hidden Field fields from rendering in the Edit Entry form using the
gravityview/edit_entry/render_hidden_fieldfilter (see code below)
Field with visibility settings
Visibility settings are found in each field's "Advanced" tab when editing a form in Gravity Forms.
Fields with "Hidden" visibility will not be included in the HTML output.
Fields with "Administrative" visibility will only be included in HTML output for users with the Administrator role
For developers: Filters to modify this behavior
To make Hidden Field fields visible editable in Edit Entry:
// Converts `<input type="hidden">` to `<input type="text">` add_filter( 'gravityview/edit_entry/reveal_hidden_field', '__return_true' );
To fully remove Hidden Field fields from Edit Entry rendering, add the following filter:
// Prevent hidden fields from being output in HTML at all add_filter( 'gravityview/edit_entry/render_hidden_field', '__return_false' );
Note: you can also modify fields displayed in Edit Entry by using the
A timeline of changes regarding rendering Hidden Field fields in Edit Entry
When Edit Entry is not configured, all form fields show by default. The way GravityView has handleed Hidden Field fields has changed over time.
Prior to Version 2.5 of GravityView, when Hidden Field fields were converted to text inputs, were visible, and were editable.
To allow modifying this behavior, the
gravityview/edit_entry/reveal_hidden_field filter was added in 1.22.6. The filter could prevent Edit Entry from converting
<input type="hidden"> to
<input type="text">. If the filter returned false, the Hidden Field input would still be rendered in HTML, but would not be visible.
With Version 2.5 in December 2019, GravityView changed how Hidden Fields behave when Edit Entry was not configured: Hidden Field fields would no longer be rendered in the form's HTML. The value of the input would no longer be visible in the webpage code, and the Hidden Field value would no longer be editable.
In Version 2.7 in February 2020, GravityView added the
gravityview/edit_entry/render_hidden_field filter to controll whether the Hidden fields are included in the HTML output or not. The default is set to
true: render the input, but do not make it visible.
By using the
gravityview/edit_entry/reveal_hidden_field filters, you have control over how Hidden Field fields are displayed in Edit Entry.