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.

Few Requests: HTML/Text Area, Duplicating Forms, Editing Address Area

  1. Hey,
    I just purchased Gravity Forms and found a few things missing that are present in other form plugins. Maybe I overlooked something and these features are already included, if so please let me know.

    HTML / Text Area: Some of the forms I have to recreate for clients include a "Terms and Conditions" area that has a large quantity of text to be displayed within the form. I tried using the section break function but it doesn't quite work for this usage.

    Almost every form I have to create is really long has to be done in multiple languages. It would be great If I could create copies of one form, then edit the titles for the other languages rather than having to rebuild them for every language. I noticed that this was requested by a few others as well. A few other Wordpress form plug-ins have this functionality.

    Someone else mentioned this as well, but It would be nice to be able to edit the labels on the address field. It would be great for non-standard address types, as well as when translations are needed. I need to have each form in at least two languages, and not being able to edit them or switch the language on a per form basis kind of negates the benefit of having a standardized area.

    I tried out the demo on the site, but probably should have done it more before purchasing. It's a great plugin and I look forward to using it more in the future.

    -Nic

    Posted 14 years ago on Thursday September 24, 2009 | Permalink
  2. Hello Nic,

    - You can create a terms and conditions box using a paragraph text field with a default value and a checkbox positioned below it with the checkbox set to being required. We plan on adding a field specific for this usage in a future release. Possibly even the next release.

    - The ability to duplicate forms will be part of the 1.2 release which we are working on now and will be released soon.

    - Sub-labels for advanced fields such as the address can be manipulated using available api hooks. I can provide sample code if you would like. Gravity Forms supports localization at the WordPress level, and these labels are translated using mo/po language files.

    I'm not sure if you are familiar with WordPress localization, but that is what the plugin uses to handle multiple languages.

    Posted 14 years ago on Thursday September 24, 2009 | Permalink
  3. The problem with editing the sub labels via hooks is that they would need to change based upon what language is being displayed. I'm using qTranslate to provide language switching (http://www.qianqin.de/qtranslate/) so maybe it is possible that I could write a function to change them based upon the currently selected language.

    -Nic

    Posted 14 years ago on Thursday September 24, 2009 | Permalink
  4. I've never used qTranslate, but if you can use PHP to check to see which language is active you could certainly use the available hook to set the address related labels based on the language qTranslate has set.

    Posted 14 years ago on Thursday September 24, 2009 | Permalink
  5. Nic,

    The hook you would use to change the address labels is a filter. Here it is:

    add_filter("gform_address_street", "set_gravityform_street_address");
    function set_gravityform_street_address($label){
        return "New Label";
    }

    The filter names are:

    gform_name_prefix
    gform_name_first
    gform_name_last
    gform_name_suffix
    gform_address_street
    gform_address_street2
    gform_address_city
    gform_address_state
    gform_address_zip
    gform_address_country

    In the functions.php file for your theme you could use the filter above and depending on the language that is selected in qTranslate adjust the field labels accordingly.

    Posted 14 years ago on Thursday September 24, 2009 | Permalink
  6. Erwin van den Boogaard
    Member

    Ok, I tried adding a condition tag around it and I put this in functions.php
    the label changing works, but the is_page() doesn't. Can anybody help me point out what I'm doing wrong here?

    if (is_page('133') ) {
    
    	// dutch translation for name field in gravity forms
    	add_filter("gform_name_prefix", "set_gravityform_name_prefix");
    	function set_gravityform_name_prefix($label){
    		return "Voorvoegsel";
    	}
    	add_filter("gform_name_first", "set_gravityform_name_first");
    	function set_gravityform_name_first($label){
    		return "Voornaam";
    	}
    	add_filter("gform_name_last", "set_gravityform_name_last");
    	function set_gravityform_name_last($label){
    		return "Achternaam";
    	}
    	add_filter("gform_name_suffix", "set_gravityform_name_suffix");
    	function set_gravityform_name_suffix($label){
    		return "Achtervoegsel";
    	}
    	add_filter("gform_address_street", "set_gravityform_address_street");
    	function set_gravityform_street_address($label){
    		return "Adres";
    	}
    	add_filter("gform_address_street2", "set_gravityform_address_street2");
    	function set_gravityform_address_street2($label){
    		return "Adres (2e regel)";
    	}
    	add_filter("gform_address_city", "set_gravityform_address_city");
    	function set_gravityform_address_city($label){
    		return "Plaats";
    	}
    	add_filter("gform_address_state", "set_gravityform_address_state");
    	function set_gravityform_address_state($label){
    		return "Provincie/Staat";
    	}
    	add_filter("gform_address_zip", "set_gravityform_address_zip");
    	function set_gravityform_address_zip($label){
    		return "Postcode";
    	}
    	add_filter("gform_address_country", "set_gravityform_address_country");
    	function set_gravityform_address_country($label){
    		return "Land";
    	}
    
    }

    Thanks,
    Erwin

    Posted 14 years ago on Monday February 8, 2010 | Permalink
  7. Jan Egbert
    Member


    Posted 14 years ago on Tuesday February 9, 2010 | Permalink
  8. Erwin van den Boogaard
    Member

    Guys?

    Posted 14 years ago on Thursday February 11, 2010 | Permalink
  9. Erwin,
    The problem is that the is_page() function only works after a certain point in the WordPress life-cycle. Calling it directly from your functions.php will not work.
    Try the following:

    add_action("loop_start", "register_filters");
    function register_filters(){
        if(is_page('41')){
            add_filter("gform_name_prefix", "set_gravityform_name_prefix");
            add_filter("gform_name_first", "set_gravityform_name_first");
            add_filter("gform_name_last", "set_gravityform_name_last");
            add_filter("gform_name_suffix", "set_gravityform_name_suffix");
            add_filter("gform_address_street", "set_gravityform_address_street");
            add_filter("gform_address_street2", "set_gravityform_address_street2");
            add_filter("gform_address_city", "set_gravityform_address_city");
            add_filter("gform_address_state", "set_gravityform_address_state");
            add_filter("gform_address_zip", "set_gravityform_address_zip");
            add_filter("gform_address_country", "set_gravityform_address_country");
        }
    }
    
    function set_gravityform_name_prefix($label){
        return "Voorvoegsel";
    }
    
    function set_gravityform_name_first($label){
        return "Voornaam";
    }
    
    function set_gravityform_name_last($label){
        return "Achternaam";
    }
    
    function set_gravityform_name_suffix($label){
        return "Achtervoegsel";
    }
    
    function set_gravityform_street_address($label){
        return "Adres";
    }
    
    function set_gravityform_address_street2($label){
        return "Adres (2e regel)";
    }
    
    function set_gravityform_address_city($label){
        return "Plaats";
    }
    function set_gravityform_address_state($label){
        return "Provincie/Staat";
    }
    
    function set_gravityform_address_zip($label){
        return "Postcode";
    }
    function set_gravityform_address_country($label){
        return "Land";
    }
    Posted 14 years ago on Thursday February 11, 2010 | Permalink
  10. Erwin van den Boogaard
    Member

    Works like a charm!
    Thanks Alex.

    Cheers,
    Erwin

    Posted 14 years ago on Friday February 12, 2010 | Permalink

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