=== Read Only Fields for Gravity Forms ===
Contributors: faisalahammad, itsmhrahman
Donate link: https://buymeacoffee.com/faisalahammad
Tags: gravity forms, readonly, field, forms, disabled field
Requires at least: 6.8
Tested up to: 7.1
Stable tag: 1.1.1
Requires PHP: 7.4
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Adds readonly (uneditable) fields to Gravity Forms, allowing you to display information users cannot change.

== Description ==

Easily add a universal "Read Only" option to any Gravity Forms field. This plugin adds a checkbox to every supported field in the Gravity Forms editor, allowing you to make any field read-only on the frontend. Includes a tooltip warning to avoid using required or merge-tag default values with read-only fields.

Fully compatible with Gravity Forms v2.x.x and v3.x.x.

== Features ==

* Adds a "Read Only" checkbox to all supported Gravity Forms fields in the form editor
* Shows a tooltip warning about not using "Required" or merge tags as default value
* Makes any supported field type (text, textarea, select, checkbox, radio, etc.) read-only/disabled on the frontend if enabled
* Excludes unsupported field types (hidden, html, captcha, page, section, form, fileupload) from the Read Only option
* Optimized for all supported field types and easy to maintain
* Adds subtle styling to read-only fields for better user experience
* Fully translatable and ready for localization

== Installation ==

1. Install and activate this plugin.
2. Make sure Gravity Forms is installed and activated.
3. Edit any Gravity Form. In the field settings, check the "Read Only" box to make a field read-only.
4. The field will be read-only/disabled on the frontend for all users.

== Usage ==

* Only supported field types will show the "Read Only" option.
* Read-only fields are visually styled and cannot be edited by users on the frontend.

== Frequently Asked Questions ==

= Why can't I make some fields read-only? =
The plugin intentionally excludes certain field types (hidden, html, captcha, page, section, form, fileupload) from the Read Only option, as these are not user-editable or not suitable for read-only status.

= Is the value of a read-only field saved with the entry? =
Yes. Since 1.1.1 the value shown in a read-only field (its default value, a dynamically populated value, or the checked/selected choices) is submitted and saved with the entry.

= Can I use this with required fields? =
Only if the field always has a value. Visitors cannot fill in a read-only field, so a required read-only field that ends up empty will fail validation.

== Screenshots ==

1. Easily make any supported field read-only with a single checkbox. Here, the 'Name' field is being made read-only.
2. The same simplicity applies to all supported field types, including 'Paragraph' fields.
3. This is how the 'Name' field will appear to users on the front end—uneditable and clearly marked as read-only.
4. The 'Paragraph' field, when set to read-only, is also disabled on the front end, preventing any user input.

== Changelog ==

= 1.1.1 - October 11, 2026 =
* Fixed: the readonly attribute was never added to text inputs and textareas, because the gf_readonly class (or any attribute value containing "readonly" or "disabled") was mistaken for the attribute itself.
* Fixed: read-only field values are now saved with the entry. Disabled fields are never submitted by the browser, so each locked field now carries its value in a hidden input.
* Improved: the frontend stylesheet now loads only on pages showing a form with a read-only field, instead of on every page.
* Improved: the Read Only tooltip text in the form editor is now translatable.
* Tested up to WordPress 7.1.
* Dev: updated coding standards tooling (PHPCompatibilityWP 2.1) and added a PHPUnit test suite.

= 1.1.0 - August 1, 2026 =
* Refactored codebase into modular class-based structure (Loader, Field_Settings, Tooltips, Field_Render, Assets) for maintainability.
* Verified full compatibility with Gravity Forms v2.x.x and v3.x.x.
* Added gf_readonly CSS class to style read-only fields on the frontend.
* No user-facing behavior change.

= 1.0.0 =
* Initial release
