Gravity Wiz

Magically enhanced tutorials, snippets and plugins for Gravity Forms!

  • Gravity Perks
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    • Documentation
    • Support
    • Account

Gravity Forms Copy Cat

Easily copy the values from one field to another in your Gravity Form.

This plugin is part of Gravity Perks, a suite of 41+ essential Gravity Forms addons with support you can count on.

  • View All Perks
  • Buy Gravity Perks
View Demo

What does it do?

This plugin allows you to copy values from one field to another within the same form. Values can be copied either automatically as they are typed or when a specific Checkbox in the form is checked.

For example, with automatic copying the user can enter their first and last name into a field, and those values will be immediately copied into the Name input on a Credit Card field as they type.

Copying with a Checkbox is particularly useful for situations like specifying a billing and shipping address. There is a good chance the user would desire to enter the same address for both fields. You can configure a Checkbox to copy the user-entered values from the billing address field to the shipping address field.

Copy Cat supports copying to and from almost all Gravity Forms fields, so the possibilities are endless!

Features

  • Copy values from one field to another.
    Save your users time by copying input values to other fields in the form.
  • Automatic or manual copying.
    Trigger the copy when the user checks a box or automatically.
  • Copy multiple fields.
    Copy values from a single source to multiple fields and from multiple sources to multiple fields!
  • Target specific inputs of multi-input fields.
    Copy only the First Name in a Name field, the Quantity of a Product field, and other specific inputs from multi-input fields.
  • Supports most Gravity Forms fields.
    Values can be copied to and from almost any field.
  • Automatic updates.
    Get updates and the latest features right in your dashboard.
  • Awesome support.
    We’re here to help! And we mean it.

Documentation

  1. How do I enable this functionality?
  2. Feature Details
    1. Automatically Copy One Field to Another Field
    2. Copy a Single Field to Multiple Fields
    3. Copy Multiple Fields to Multiple Fields
    4. Target Specific Inputs of Multi-input Fields
    5. Supported Fields
  3. Hooks
  4. Related Articles

How do I enable this functionality?

After installing and activating Copy Cat, the perk is activated by adding a specially formatted CSS class to a supported field.

The process for setting up Copy Cat differs depending on whether you want to automatically copy or trigger the copy on a Checkbox.

Let’s step through how to set up a Checkbox to manually trigger copying one field to another. We’ll cover automatically copying in another section below.

Add a Checkbox field to your form.
Adding the specially formatted CSS class to the checkbox field via the Custom CSS Class setting under the Advanced tab.

The syntax for Copy Cat’s CSS class is copy-{fieldId}-to-{fieldId}

Replace the first {fieldId} with the ID of the field you will be copying from and the second {fieldId} with the ID of the field you will be copying to.

Use the field ID to copy all inputs of a field into another field. Use the input ID if you want to copy to or from a specific input. When in doubt, just use the field ID.

When the Checkbox field is checked, Copy Cat will automatically copy the value from the “source” field ID to the “target” field ID.


Feature Details

Automatically Copy One Field to Another Field

GP Copy Cat also supports automatically copying one field to another. To accomplish this, you would add the Copy Cat class to the “source” field rather than a Checkbox field.

For example, if you want to copy a value from field ID 1 to field ID 2, you would add the class to field ID 1 and it will then automatically copy that value into field ID 2.

If you have other classes in this field, add a space after the last existing class and add the Copy Cat class to the end.

Copy a Single Field to Multiple Fields

If you’d like a single checkbox to copy the values from one field to multiple other fields, just append another Copy Cat CSS class.

copy-{fieldId}-to-{fieldId} copy-{fieldId}-to-{fieldId}

Translated into some sample field ID fields, it would like like this:

copy-1-to-2 copy-1-to-3

Copy Multiple Fields to Multiple Fields

Using the same concept as copying multiple fields, we can also copy multiple fields to other fields.

copy-1-to-2 copy-3-to-4 copy-5-to-6

This would allow you to copy multiple groups of fields to another group of fields in a single batch.

A good use case for this functionality is when you need to copy all billing information (name, phone number, email, etc) to the shipping portion of your form (assuming you are doing some form of ecommerce with Gravity Forms).

Target Specific Inputs of Multi-input Fields

Some fields, like the Address and Name field, have multiple inputs. You can copy from or to a specific input by referencing the input ID in the Copy Cat CSS class.

  • Copy “Last Name” from one Name field to another

    copy-1.3-to-2.3

  • Copy First and Last Name to Credit Card “Name” Input

    copy-1-to-3.5

  • Copy “State” input from Address field to a Single Line Text field

    copy-4.4-to-6

Supported Fields

  • Standard Fields: Single Line Text, Paragraph, Drop Down, Multi Select, Checkboxes, Number, Radio Buttons, Hidden
  • Advanced Fields: Name, Date, Time, Phone, Address, Website, Email, List
  • Post Fields: Title, Body, Excerpt, Tags*, Category*, Custom Field*
  • Product Fields: Product*, Quantity, Option*, Shipping

Note: While this is the official list of supported fields, it is not an exhaustive list. Many other fields may be supported depending on their configuration.

(*) Field is supported if configured to use a supported input type.

Hooks

  • gpcc_copied_value (JS)
  • gpcc_copy_cat_fields (JS)
  • gpcc_custom_clear (JS)
  • gpcc_custom_copy (JS)
  • gpcc_field_group (JS)
  • gpcc_overwrite_existing_values_on_init
Gravity Forms has hundreds of hooks. Check out our Gravity Forms Hook Reference for the most thorough guide to Gravity Forms’ many actions and filters.

Related Articles

  • How to Setup Bulk Pricing with a Calculated Unit for Gravity Forms
  • How To Set Up Conditional Pricing with Nested Forms

Perk Deets

  • Version 1.4.56
  • Updated August 2, 2022
  • Released January 19, 2013
  • View Changelog

Changelog

1.4.56

  • Fixed issue with List fields not properly removing rows in target List fields if using newer form markup versions.

1.4.55

  • Fixed an issue that could occur with infinite recursion in some form setups with conditional logic.

1.4.54

  • Fixed performance issue when clearing values was triggered via conditional logic.
  • Fixed an issue where clearing values for checkbox triggers when a target input was revealed via conditional logic could created an infinite loop.

1.4.53

  • Fixed issue where GPCC's conditioanl logic handling would overwrite edited values when the form was reloaded.

1.4.52

  • Fixed issue where multiple values copied into a single input would not be cleared if unchecking a checkbox.
  • Fixed issue where using the gpcc_copied_value filter would prevent filtered values from being cleared if the checkbox controlling the copying is unchecked.
  • Added "Update URI" to plugin header to improve security.

1.4.51

  • Added getSourceField method to gwCopyObj to open up more possibilities with snippets such as automatic copying depending on checkbox value.

1.4.50

  • Improved conditional logic handling for accuracy and efficiency. (#40)

1.4.49

  • Improved performance by only triggering change events when value has actually changed.

1.4.48

  • Fixed issue where copying from one List field to another did not work in Gravity Forms 2.5.

1.4.47

  • Fixed issue where only the first Copy Cat class was respected when clearing values after a checkbox click.

1.4.46

  • Fixed a potential issue where conditionally hidden target fields may not be copied to if manual copy is used to also show the target fields.
  • Fixed an issue where multiple conditionally hidden inline date pickers would not trigger copy on page load.

1.4.45

  • Fixed a regression where GPCC would not copy values to hidden fields.

1.4.44

  • Fixed a potential issue where copied prices to radio fields may not update the form's total amount.
  • Fixed an issue where GPCC would not copy values to quantity fields correctly.

1.4.43

  • Fixed an issue where the gpcc_copied_value filter did not fire when copying checkbox or radio fields.

1.4.42

  • Fixed an issue where conditional logic may clear copied fields after hiding them multiple times.
  • Improved consistency of how Total field values are handled by always removing the currency symbol and thousand separators.

1.4.41

  • Fixed an issue where GPCC would apply custom CSS even when no value was copied.
  • Fixed potential recursion issue when pricing and conditional logic are used together.
  • Improved performance on larger forms.

1.4.40

  • Fixed a potential issue where manual copying may be triggered by conditional logic.

1.4.39

  • Fixed a potential error when GPCC is used in a form with a coupon code.

1.4.38

  • Fixed a potential issue where conditionally shown fields may not trigger a copy action.

1.4.37

  • Fixed an issue where GPCC could lag on large AJAX enabled forms.

1.4.36

  • Added a new parameter to gpcc_custom_copy and gpcc_custom_clear distinguishing the current field being operated on.

1.4.35

  • Fixed an issue where conditional logic may not trigger on target radio fields.

1.4.34

  • Added gpcc_custom_copy and gpcc_custom_clear filters to handle corner cases.

1.4.33

  • Added GF Chained Selects Support.

1.4.32

  • Fixed issue where using a Password field with confirmation as a source field would result in the password and confirm password inputs being concatenated rather than just copying the password.

1.4.31

  • Fixed a regression where GPCC may throw a JS error if the class is added to the target field.

1.4.30

  • Fixed issue where value filtered with deprecated filter was ignored.

1.4.29

  • Fixed a regression with subfields copying introduced in 1.4.26.

1.4.28

  • Fixed an issue where the new gpcc-populated classes may apply on page load.

1.4.27

  • Added gpcc-populated-input and gpcc-populated to mark populated inputs and their parent field container respectively.

1.4.26

  • Fixed an issue where values weren't copied if the target field is a rich text editor.
  • Fixed issue where clicking a checkbox would result in a JavaScript error rather than copying values when using Gravity Forms 2.5 and newer.

1.4.25

  • Fixed an issue where clearing copied values would fail for checkboxes.

1.4.24

  • Fixed issue where Drop Down value was set to null when attempting to populate value that did not exist.
  • Updated plugin author.

1.4.23

  • Added support for copying simple value to their equivalent value in a choice-based Pricing field.

1.4.22

  • Added "gpcc_field_group" filter to allow including non-GF inputs in the Copy Cat field group.

1.4.21

  • Added support for targeting Credit Card field expiration date.

1.4.20

  • Fixed issue where when resuming from Gravity Forms' Save & Continue - and - deleting an entry from a source List field, it would remove all except one row from the target List field.

1.4.19

  • Fixed issue where no rows were added when Maximum Rows was not set.

1.4.18

  • Fixed issue when copying from List field to read-only List field (via GP Read Only).
  • Fixed issue with row count when copying from List field to List field.
  • Added support for respecting List field "Maximum Rows" setting.
  • Updated bootstrap for WordPress styling changes.

1.4.17

  • Added support for copying from specific List field column to another List field column.
  • Added support for clearing a target List field when a row from the source List is removed.

1.4.16

  • Added 'gpcc_copied_value' filter to allow modifying the copied value before it is inserted into the target field.

1.4.15

  • Added support for not overwriting target values by default when the form is rendered; resolves issue where target values were overridden when loading data via Save & Continue.
  • Added 'gpcc_overwrite_existing_values_on_init' filter; allows forcing source values to overwite target values when form is rendered.
  • Updated gwCopyObj JS object to be more extensible.

1.4.14

  • Fixed issue in gwCopyCat class where assignment issue result in errors.

1.4.13

  • Updated copyValues() to trigger conditional logic for unchecked inputs in addition to checked inputs.

1.4.12

  • Updated forceEmptyCopy option to default to the value of isOverride; this will automatically overwriting existing values with empty valeus.

1.4.11

  • Fixed issue where coping to hidden fields was broken in v1.4

1.4.9

  • Fixed issue where target List field rows could be completely removed when targeted from another List field.
  • Fixed issue where read only checkboxes were unchecked incorrectly have being checked.

1.4.8

  • Fixed issue where copying checkbox field to checkbox field did not correctly clear unselected checkbox fields from the target field.

1.4.7

  • Fixed issue where targeting a field from itself (via copy cat class) would cause infinte loop.

1.4.6

  • Fixed issue introduced in 1.4.5 that would incorrectly sort values when copying from multi-input fields.

1.4.5

  • Added support for copying to/from a specific List field column or input.
  • Fixed issue where copying to a clickable field would not correctly "check" the field.

1.4.4

  • Updated to only select inputs from inside the .ginput_container class.

1.4.3

  • Added 'gpcc_copy_cat_fields' filter to allow adding copy cat fields programmatically. See: https://gist.github.com/spivurno/51df05b385c0b93f3eef7c582a2d9d13

1.4.2

  • Updated List field support to copy by row/column index; better supports mapping non-identical List fields to each other.

1.4.1

  • Fixed issue were gravityforms.js dependency was not enforced.

1.4

  • Added support for copying to and from List fields. A special thanks to Edi Weigh for sponsoring this feature.

1.3.13

  • Fixed issue where conditional logic based on checkable fields (i.e radio, checkbox) was not applied when copying to a checkable field

1.3.12

  • Added support for clearing deselected checkbox values when copying into a Single Line Text field

1.3.11

  • Fixed issue when clearing checked checkboxes

1.3.9

  • Fixed issue where Radio Buttons could be copied from but not to

1.3.8

  • Fixed issue where Enhanced-UI-enabled drop downs did not copy correctly

1.3.7

  • Updated so copied values overwrite existing values by default.
  • Updated 'gp-copy-cat' script to depend on 'jquery'

1.3.6

  • Updated perk to use GP_Bootstrap

1.3.5

  • Added support for copying values from one form to another (on the same page)

1.3.4

  • Updated init copy to no longer force overwriting values (caused changes to be overwritten on validation error)

1.3.3

  • Added initial support for field-type-sensitive copying (i.e. copying from calculation field to quantity field: 1,024 is converted to 1024)

1.3.2

  • Fixed issue where unchecked checkboxes were copying their associated copy cat fields on form render

1.3.1

  • Added support for processing checkbox-based copy cats on init; allows checking box on page 1 to copy value to field on page 2

1.3

  • Major overhaul to codebase to better confirm to Gravity Forms standards
  • Updated JS to be loaded in separate file
  • Add helper functions has_copy_cat_field() and get_copy_cat_fields() to consolidate these checks and processes

1.2.7

  • Added support for auto-copying from a drop down
  • Added support for auto-copying when a value is pre-populated

1.2.6

  • Fixed issue where values were not clearing from field when checkbox was unchecked

1.2.5

  • Added support for copying checkboxes to checkboxes

1.2.4

  • Added support for targeting Quantity inputs on Single Product fields

1.2.3

  • Fixed issue where targetting specific input of email field did not allow copying of value

1.2.2

  • Added support for copying from specific inputs of multi-input fields to single input fields or specific inputs of other multi-input fields

1.2.1

  • Added support for copying textareas

1.2

  • Updated support for copying only the selected value from radio and checkbox fields

1.1

  • Added support for copying values when the field value changes, allowing support for automatically copying a value from one field two another without a checkbox

1.0.7

  • Fixed bug introduced in 1.0.6 where Country (if select type) was not copied

1.0.6

  • Fixed issue where calcultions were not updated when copy cat enabled fields were updated

1.0.5

  • Fixed issue which caused Copy Cat to break when applied to multiple forms displayed on the same page

1.0.4

  • Added namespace to checkbox click event which triggers copy cat functionality ("click.gpcopycat")
  • Added form-specific instance of gwCopyObj to #gform_wrapper div for use in customizations

1.0.3

  • Updated minimum required version of Gravity Perks: 1.0.6
  • Added 'gpcc_overwrite_existing_values' filter to allow users to indicate whether existing values in fields being copied to should have their value overwritten if already have a value

1.0.1

  • Updated minimum required version of Gravity Perks: 1.0.5
  • Updated documentation to return GravityWiz.com URL

All Perks

  • GF Address Autocomplete
  • GF Advanced Calculations
  • GF Auto List Field
  • GF Auto Login
  • GF Better User Activation
  • GF Blocklist
  • GF Conditional Logic Dates
  • GF Conditional Pricing
  • GF Copy Cat
  • GF Date Time Calculator
  • GF Disable Entry Creation
  • GF Easy Passthrough
  • GF eCommerce Fields
  • GF Email Users
  • GF Entry Blocks
  • GF Expand Textareas
  • GF File Upload Pro
  • GF Inventory
  • GF Limit Checkboxes
  • GF Limit Choices
  • GF Limit Dates
  • GF Limit Submissions
  • GF Live Preview
  • GF Media Library
  • GF Multi-Page Navigation
  • GF Nested Forms
  • GF Notification Scheduler
  • GF Page Transitions
  • GF Pay Per Word
  • GF PayPal One-time Fee
  • GF Placeholder
  • GF Populate Anything
  • GF Post Content Merge Tags
  • GF Preview Submission
  • GF Price Range
  • GF QR Code
  • GF Randomizer
  • GF Read Only
  • GF Reload Form
  • GF Terms Of Service
  • GF Unique ID
  • GF Word Count

Copyright © 2022 · Powered by WordPress · Gravity Wiz LLC

  • Support
  • Affiliates
  • About
  • Sitemap
  • Terms & Conditions of Use
  • Privacy Policy
  • Cookies Policy

Get access to hundreds of Gravity Forms plugins for free!

Enter your email and receive a list of our most popular free snippets and plugins for Gravity Forms.

  • Gravity Perks
    ▼
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    ▼
    • Documentation
    • Support
    • Account