PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Read Only Fields

  1. tonyallsopp

    Can any please please please guide me as to how to set a field (or multiple fields) to be read only? I've read a couple of posts on here where you've directed people to a form post on (, but I can't figure out how or where to put the couple of little code snippets they suggest.
    It would be great long-term if GF could add a simple check-box option to each field, where you could specify a field to be read only, but short-term, is there any chance of a little bit more help here? I'm sure there would be many other (non-coding) people out there that would find this helpful as well.
    Many, many thanks in advance,

    Posted 5 years ago on Wednesday September 21, 2011 | Permalink
  2. Hi Tony,

    Here is a code snippet that will make any input field read only. Just added the class "readonly" to the settings for that field.

    You should paste this code in your theme's functions.php file:

    Posted 5 years ago on Wednesday September 21, 2011 | Permalink
  3. David,
    Thank you for the script, it works great. The only issue is if the the form isn't valid, and throws up a validation error message, the field become writable again.

    Any ideas how I can stop this from happening?

    Posted 4 years ago on Thursday March 1, 2012 | Permalink
  4. Hi mgyura,

    Give this a shot:

    Posted 4 years ago on Tuesday March 6, 2012 | Permalink
  5. kayrum

    Hi David

    Your function works great when using in a simple form but, when included in the functions.php on a multi page form it hides the whole form (page is blank)

    Posted 4 years ago on Monday October 1, 2012 | Permalink
  6. @kayrum, please post a link to the page with your form embedded so we can take a look. Sounds like you have a JavaScript or jQuery error.

    Posted 4 years ago on Monday October 1, 2012 | Permalink
  7. kayrum

    Hi Chris

    Yes it was a javascript issue, which I sorted by only calling the script on the specific page the form shortcode was in.

    Thanx for your comment.

    Posted 3 years ago on Friday October 5, 2012 | Permalink
  8. Thanks for the update @kayrum.

    Posted 3 years ago on Saturday October 6, 2012 | Permalink

This topic has been resolved and has been closed to new replies.

Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only