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.

Make a readonly field

  1. Hello, this plugin is as better as i could imagine. But i don't know how to
    solve something:
    I have two forms, the first one is a first step form that pass Field Data
    via query string to the second form. In the second form I get the content
    of the variables and show in some fields. I would like that user can't
    edit this fields.
    There is a way to use the readonly in some fields?
    Thanks

    Posted 14 years ago on Tuesday July 6, 2010 | Permalink
  2. I took a quick look and didn't see this functionality available by default but it's pretty easy to add yourself.

    1. On the advanced tab for each field add a "disable" class.

      This is just a class name that we will use to reference any elements that you want disabled so all though it makes sense to call it "disable" it can actually be anything you want.

    2. Make sure that you've queued jQuery and add the following to you header.php:
      <script type="text/javascript">
      		jQuery(document).ready(function($){
      			$(".gform_wrapper .disable input").attr('disabled','disabled');
      		});
      	</script>

      This will disable all Gravity Form fields with the disable class that are inputs. If you need to also disable a select or any other field type, you will need to specify this like so:
      $(".gform_wrapper .disable input, .gform_wrapper .disable select").attr('disabled','disabled');

    3. Hope that helps.

    Posted 14 years ago on Tuesday July 6, 2010 | Permalink
  3. Thanks.. It worked.. only a few moments, i don't know why it doesn't work
    anymore.
    It's really rare...
    Do you know why this is happening?

    Solved, in header.php I have to write < ? php wp_enqueue_script("jquery"); ? >

    Posted 14 years ago on Wednesday July 7, 2010 | Permalink

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