CALL (239) 961-8285
ENDURTECH
  • Web Services
    • Web Design
      • Design and Development
      • Web Consulting and Tutoring
      • Hosting and Maintenance
      • Project Portfolio
    • Media
      • Photo and Audio, Video Editing
      • Social Media Management
      • All Web Related Services
    • Marketing
      • Digital Marketing and Branding
      • Search Engine Optimization
    • Client Portal
      • Remote Web Support
      • Web Services Payment
      • Scheduled Payments
  • Tech Support
    • Services
      • Computer Support and Repair
      • Data Backup and Recovery
      • Computer Security, Virus Removal
      • Computer Networking Support
      • Computer Consulting & Tutoring
      • All Technology Related Services
    • Blockchain
      • Blockchain Technology
      • Cryptocurrency Articles
    • Client Portal
      • Remote PC Support
      • Remote Monitoring & Management
      • Tech Services Payment
  • Articles
  • About
  • Talk to Me
  • Menu Menu

Create Read-only Field in Gravity Forms

Gravity Forms, Plugins, Web Site Support, WordPress

Need to prevent a visitor or user from changing a specific form field on one of your Gravity Forms? Using the provided code snippet within this article, you can convert any input field into a “read-only” field. This type of field is different from a hidden field as it will display the contained data but prevent the visitor from altering it.

Sometimes making a field read-only can be useful, allowing you to then utilize that field for dynamic display of various messages. If you want to change a field to be read-only, you currently need to use JavaScript to do so. The following code snippets will help you accomplish this.

 

Gravity Forms Read-Only Field

 

Read-only Fields in Gravity Forms

Begin by adding a Custom CSS Class to the field(s) you wish to have as a read-only. This is how the script targets the field and converts it to read-only. You can use any class name you want but for purposes of this tutorial I will use a class name of “gf_readonly“. This is also the CSS class name that my CSS Ready Classes WordPress Plugin uses. But you may modify the any of the snippets as needed. Read more on the Gravity Forms Documentation website.

After applying the gf_readonly css class to your targeted form field you need to use JavaScript to modify the field. The examples below can be inserted into your WordPress child themes‘ functions.php file. Alternatively you may simply extract the JavaScript portion of the snippet and insert it into an HTML form field. This way you better manage the read-only fields. This is actually my preferred method.

Some other important notes; If you have multiple textarea fields with the gf_readonly class added to them, then they will ALL be read-only. Also, if your field is NOT on the first page of a multi-page form, then you’ll want to look at the official gform_page_loaded documentation for additional information.

 

Read-only Textfield in Gravity Forms

The Javascript code snippet below will show you how to target and mark as read only any input textfield in your form. Note that this will only work on the specified form ID on the add_filter. If you copy and paste the code below, be sure to paste it in as plain text and without the PHP start and end tags:

 

Read-only Textarea Field in Gravity Forms

The Javascript code snippet below will show you how to target and mark as read only any paragraph textarea in your form. Note that this will only work on the specified form ID on the add_filter. If you copy and paste the code below, be sure to paste it in as plain text and without the PHP start and end tags:

 

Read-only Checkbox Field in Gravity Forms

The Javascript code snippet below will show you how to target and mark as read only any Checkbox Fields in your form. Note that this will only work on the specified form ID on the add_filter. If you copy and paste the code below, be sure to paste it in as plain text and without the PHP start and end tags:

 

Read-only Radio Field in Gravity Forms

The Javascript code snippet below will show you how to target and mark as read only any Radio Buttons in your form. Note that this will only work on the specified form ID on the add_filter. If you copy and paste the code below, be sure to paste it in as plain text and without the PHP start and end tags:

 

Conclusion

I welcome your thoughts, questions or suggestions on my article on creating a read-only input form field using Gravity Forms (affiliate link).

You may support my work by sending me a tip using your Brave browser or by sending me a one time donation using your credit card.

Let me know if you found any errors within my article or if I may further assist you by answering any additional questions you may have.

 

Editors Note:

  • This article was first published on May 25th, 2018 and was revised on October 27th, 2020 to include additional read-only field options and other context based improvements.

 

October 27, 2020
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://endurtech.com/wp-content/uploads/2018/04/gravityforms.jpg 512 512 Manny https://endurtech.com/wp-content/uploads/2018/04/endurtech-logo.png Manny2020-10-27 12:53:502020-10-27 12:55:37Create Read-only Field in Gravity Forms
Search Search

CONNECT WITH US

This field is for validation purposes and should be left unchanged.
Engagement*

Want to say, "thanks"?
Leave me a review on Facebook and/or Google.

You can send me a tip using your Brave browser. Get Brave!

Only used to send you a receipt.
Include a Message
Popular
  • Windows Logo
    Second Monitor on Windows 10 Resets After SleepJuly 2, 2020 - 6:30 am
  • Windows Logo
    How to Disable the F1 Help Key in Windows 10April 15, 2021 - 2:40 pm
  • Cortana Logo
    How to Disable Microsoft’s CortanaApril 6, 2021 - 9:00 am
  • Firefox Logo
    How to Remove All Passwords from Lockwise in FirefoxMarch 26, 2020 - 11:00 am
Recent
  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar Err...July 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

STAY IN TOUCH

ENDURTECH Web Design Company Naples, Florida

Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Learn More & Connect

Search Search
ENDURTECH Logo
Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Latest Articles

  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar ErrorJuly 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

Recent Projects

  • Jewelry Website Gems of Note
    Gems of NoteNovember 15, 2019 - 10:16 pm
  • Gift Store Facebook Business Page Cover Video
    Gift Store Facebook Business Page Cover VideoApril 13, 2019 - 3:58 pm
  • Toledo Yoga BrandBot Footer Integration
    Toledo YogaApril 9, 2019 - 7:26 am
  • Lawyer Association Website with Member Portal
    National Employment Lawyers Association, Florida ChapterFebruary 26, 2019 - 8:00 am

Business Details

Mondays - Fridays
9:00 am - 5:00 pm
Eastern Standard Time
After hours by appointment

SUPPORT PHONE

(239) 961-8285

MAILING ADDRESS

59 Logan Ln.
Lynchburg, VA 24502

Copyright © 2026 ENDURTECH ® All Rights Reserved. Legal
Link to: How to Email Large Files with Gmail, Google Drive Link to: How to Email Large Files with Gmail, Google Drive How to Email Large Files with Gmail, Google DriveGMail Logo Link to: Remove Existing Trackbacks and Pingbacks on Pages and Posts Link to: Remove Existing Trackbacks and Pingbacks on Pages and Posts WordPress Content Management System IconRemove Existing Trackbacks and Pingbacks on Pages and Posts
Scroll to top Scroll to top Scroll to top