Site icon WP Smith

Gravity Forms Snippets for Me to Remember

How to add a custom predefined choice list for Gravity Forms
[php]// Add Custom Predefined Choice list for Gravity Forms
add_filter("gform_predefined_choices", "add_predefined_choice");
function add_predefined_choice($choices){
$choices["US/Canadian Regions"] = array("Virginia", "Augusta", "XXXX");
return $choices;
}[/php]

To get an editor (similar to TinyMCE) for paragraph text fields in GF:

  1. copy this code into an HTML block on a GF form
  2. [html]
    <script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
    <script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>[/html]

  3. That's it!

NOTE - this will not work for paragraph fields set to conditional.