Repeater styling different

Hi,

I have successfully added a repeater to my form. The styling of my form is exactly using the CSS as per the rest of the design of the website. However, the repeater is not. It seems to have adopted it’s own styling.

Here is my code:
// Adjust your form ID
add_filter( ‘gform_form_post_get_meta_1’, ‘add_my_field’ );
function add_my_field( $form ) {

    $companyname = GF_Fields::create( array(
        'type'   => 'text',
        'id'     => 1001, // The Field ID must be unique on the form
        'formId' => $form['id'],
        'label'  => 'Company Name',
        'pageNumber'  => 1, // Ensure this is correct
    ) );
 
    $datefrom = GF_Fields::create( array(
        'type'   => 'date',
        'id'     => 1002, // The Field ID must be unique on the form
        'formId' => $form['id'],
        'label'  => 'Date From',
        'pageNumber'  => 1, // Ensure this is correct
    ) );
  
  $dateto = GF_Fields::create( array(
        'type'   => 'date',
        'id'     => 1003, // The Field ID must be unique on the form
        'formId' => $form['id'],
        'label'  => 'Date To',
        'pageNumber'  => 1, // Ensure this is correct
    ) );
  
  $historydiscription = GF_Fields::create( array(
        'type'   => 'text',
        'id'     => 1004, // The Field ID must be unique on the form
        'formId' => $form['id'],
        'label'  => 'Grade, title and description of your role',
        'pageNumber'  => 1, // Ensure this is correct
    ) );
  
  $reasonforleaving = GF_Fields::create( array(
        'type'   => 'text',
        'id'     => 1005, // The Field ID must be unique on the form
        'formId' => $form['id'],
        'label'  => 'Reason for leaving',
        'pageNumber'  => 1, // Ensure this is correct
    ) );
 
    $team = GF_Fields::create( array(
        'type'             => 'repeater',
        'description'      => 'Maximum of 5 employment history items.',
        'id'               => 1000, // The Field ID must be unique on the form
        'formId'           => $form['id'],
        'label'            => 'Employment History',
        'addButtonText'    => 'Add history', // Optional
        'removeButtonText' => 'Remove history', // Optional
        'maxItems'         => 5, // Optional
        'pageNumber'       => 1, // Ensure this is correct
        'fields'           => array( $companyname, $datefrom, $dateto, $historydiscription, $reasonforleaving ), // Add the fields here.
    ) );
 
    $form['fields'][] = $team;
 
    return $form;
}
 
// Remove the field before the form is saved. Adjust your form ID
add_filter( 'gform_form_update_meta_1', 'remove_my_field', 10, 3 );

function remove_my_field( $form_meta, $form_id, $meta_name ) {
 
    if ( $meta_name == 'display_meta' ) {
        // Remove the Repeater field: ID 1000
        $form_meta['fields'] = wp_list_filter( $form_meta['fields'], array( 'id' => 1000 ), 'NOT' );
    }
 
    return $form_meta;
}

Thanks for reading.

Hi Paul. I see that you have opened a support ticket already, so I will let support answer that one. I’ll leave this open in case anyone has relevant feedback for you though.

Thanks Chris. What sort of response times are there on the support tickets?

Thanks.

Hi Paul. You can see our support time commitments here:

I would expect an answer today. Thanks for your patience.

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.