Fix for gform_column_input_content textarea copying data

Warning
Gravity Forms has integrated this fix into the main plugin. This should only be run if there is a dire need to run an old version

On the page https://www.gravityhelp.com/documentation/article/gform_column_input_content/, Gravity Forms describes how to change a column in a list field to a paragraph field. The problem I ran into was that each time I hit the plus button, the data I entered into the field was cloned.

Example

The Fix

On the Admin Page:

  1. Select Plugins
  2. Select Editor
  3. In the top-right Select Gravity Forms
  4. In the file list on the right hand side, choose gravityforms/js/gravityforms.min.js

Should look like this:

Now do a Ctrl-F to find this bit of code below:

function gformAddListItem(a,b){var c=jQuery(a);if(!c.hasClass("gfield_icon_disabled")){var d=c.parents(".gfield_list_group"),e=d.clone(),f=d.parents(".gfield_list_container"),g=e.find(":input:last").attr("tabindex");e.find("input, select").attr("tabindex",g).not(":checkbox, :radio").val(""),e.find(":checkbox, :radio").prop("checked",!1),e=gform.applyFilters("gform_list_item_pre_add",e,d),d.after(e),gformToggleIcons(f,b),gformAdjustClasses(f)}}

Select the whole thing and change it to this:

function gformAddListItem(a,b){var c=jQuery(a);if(!c.hasClass("gfield_icon_disabled")){var d=c.parents(".gfield_list_group"),e=d.clone(),f=d.parents(".gfield_list_container"),g=e.find(":input:last").attr("tabindex");e.find("input, select, textarea").attr("tabindex",g).not(":checkbox, :radio").val(""),e.find(":checkbox, :radio").prop("checked",!1),e=gform.applyFilters("gform_list_item_pre_add",e,d),d.after(e),gformToggleIcons(f,b),gformAdjustClasses(f)}}

Now go ahead and hit submit. Everything should work appropriately now!

Leave a Reply

Your email address will not be published. Required fields are marked *