gpcc_copied_value (JS)

  1. Description
  2. Usage
  3. Parameters
  4. Example
    1. Copy Label Instead of Value
  5. Since

Description

Filter the copied value before moving it over.

Usage

gform.addFilter( 'gpcc_copied_value', 'my_custom_function' );

Parameters

  • value string | array

    Current value being copied.

  • targetElem array

    A jQuery object with the target element.

  • field mixed

    Current field being copied.

Example

Copy Label Instead of Value

Copy a choice-based (Radio Button, Drop Down, etc.) field’s label instead of its value.

gform.addFilter( 'gpcc_copied_value', function( value, $elem, data ) {
    $source = jQuery( '#input_' + data.sourceFormId + '_' + data.source );
    if( $source.is( 'select' ) ) {
        value = $source.find( 'option:selected' ).text();
    }
    return value;
} );

Since

This filter is available since Gravity Forms Copy Cat 1.4.22.