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.

gform_field_standard_settings doesn't work

  1. fuhrmara
    Member

    It looks like that the hook gform_field_standard_settings doesn't work right.

    When you use the example from http://www.gravityhelp.com/documentation/page/Gform_field_standard_settings
    this only works at the default text field.
    But this doesn't have any effect to all other fields.

    Why ?
    And how could i add a setting to all field-types ?

    Regards
    Ralf

    Posted 12 years ago on Tuesday March 6, 2012 | Permalink
  2. Hey Ralf, in this piece of the code here:

    add_action("gform_editor_js", "editor_script");
    function editor_script(){
        ?>
        <script type='text/javascript'>
            //adding setting to fields of type "text" and "radio"
            fieldSettings["radio"] += ", .encrypt_setting";
    	fieldSettings["text"] += ", .encrypt_setting";
    
            //binding to the load field settings event to initialize the checkbox
            jQuery(document).bind("gform_load_field_settings", function(event, field, form){
                jQuery("#field_encrypt_value").attr("checked", field["encryptField"] == true);
            });
        </script>
        <?php
    }

    All you need to do is add the field types you'd like to apply this to. You can see above I added:

    fieldSettings["radio"] += ", .encrypt_setting";

    Hope this helps!

    Posted 12 years ago on Wednesday March 7, 2012 | Permalink
  3. fuhrmara
    Member

    Hi !

    Thanks.
    But how could a retrieve a list of all field-types of the current form ?

    Regards
    Ralf

    Posted 12 years ago on Wednesday March 7, 2012 | Permalink
  4. fuhrmara
    Member

    Another questions to this.

    All happens at the admin-section.
    So it's better to add a if (is_admin()) in front of the add_action functions,
    so this will only happened at the backend ?

    Regards
    Ralf

    Posted 12 years ago on Wednesday March 7, 2012 | Permalink
  5. fuhrmara
    Member

    Hi !

    Instead of all field-types of the current form, is there a function to retrieve all registered field-types.
    This should be available at a gform_editor_js action function.

    Regards
    Ralf

    Posted 12 years ago on Wednesday March 7, 2012 | Permalink