title: Make Repeater beta's fields required for the first entry
body: <p>So, I am working with the Repeater beta add-on for Gravity Forms (<a href="https://docs.gravityforms.com/repeater-fields/" rel="nofollow noreferrer">https://docs.gravityforms.com/repeater-fields/</a>), and I need to make it required--or more specifically, the first entry within it's field. I have tried various methods to no avail and am not sure why.</p>
  
  <ul>
  <li>I tried setting "required" to true for the fields inside the repeater</li>
  <li>I tried setting the "required" to true for the repeater field itself </li>
  <li>I tried having the repeater field AND the fields within it required </li>
  <li>In the admin, every time I click the "Required" checkbox for the repeater field, the checkbox becomes unchecked after saving the form</li>
  <li>Using <code>$(window).load</code> I tried adding a <code>required=required</code> attribute to all fields in the repeater but that prevents the only fields in the form from displaying any "required" messages to the user, and only the first empty field in the repeater is actually checked. The rest, even if empty, are not, and do no display a "required" message.</li>
  <li>Using <code>$(document).ready()</code> but the results were similar to above but the rest of the form fields started validating again</li>
  <li>Browsing the Gravity Forms forum but could not find the answer I was looking for, and I don't know how long it will take for anyone to respond to my question and this can't wait days or weeks.</li>
  </ul>
  
  <p>This is all the code I setup for the repeater in <code>functions.php</code> per the field's documentation example:</p>
  
  <pre><code>// Adjust your form ID
  add_filter( 'gform_form_post_get_meta_5', 'add_my_field' );
  function add_my_field( $form ) {
      // Create a Single Line text field for the product member's name
      $purchasedFrom = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'id'     =&gt; 1002, // The Field ID must be unique on the form
          'formId' =&gt; $form['id'],
          'required' =&gt; true,
          'label'  =&gt; 'Purchased From',
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
      $itemtype = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'id'     =&gt; 1007, // The Field ID must be unique on the form
          'formId' =&gt; $form['id'],
          'required' =&gt; true,
          'label'  =&gt; 'Item Type',
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
      // Create an email field for the product s
      $quantity = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'id'     =&gt; 1001, // The Field ID must be unique on the form
          'formId' =&gt; $form['id'],
          'required' =&gt; true,
          'label'  =&gt; 'Quantity',
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
      $purchasedDate = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'id'     =&gt; 1003, // The Field ID must be unique on the form
          'formId' =&gt; $form['id'],
          'label'  =&gt; 'Date of Purchase',
          'required' =&gt; true,
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
      $serviceDate = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'id'     =&gt; 1004, // The Field ID must be unique on the form
          'required' =&gt; true,
          'formId' =&gt; $form['id'],
          'label'  =&gt; 'Date Out of Service',
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
      $size = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'required' =&gt; true,
          'id'     =&gt; 1009, // The Field ID must be unique on the form
          'formId' =&gt; $form['id'],
          'label'  =&gt;'Size',
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
      $upc = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'required' =&gt; true,
          'id'     =&gt; 1010, // The Field ID must be unique on the form
          'formId' =&gt; $form['id'],
          'label'  =&gt; 'UPC/Part # (From Receipt)',
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
      $damage = GF_Fields::create( array(
          'type'   =&gt; 'text',
          'required' =&gt; true,
          'id'     =&gt; 1005, // The Field ID must be unique on the form
          'formId' =&gt; $form['id'],
          'label'  =&gt; 'Description of Damage',
          'pageNumber'  =&gt; 1, // Ensure this is correct
      ) );
  
  
      // Create a repeater for the product and add the name and email fields as the fields to display inside the repeater.
      $product = GF_Fields::create( array(
          'type'             =&gt; 'repeater',
          'required'          =&gt; true,
          'id'               =&gt; 1000, // The Field ID must be unique on the form
          'formId'           =&gt; $form['id'],
          'label'            =&gt; 'Add Products',
          'addButtonText'    =&gt; 'Add Another Product',
          'removeButtonText'=&gt; 'Remove Product',
          'pageNumber'       =&gt; 1, // Ensure this is correct
          'fields'           =&gt; array( $purchasedFrom,$itemtype, $quantity, $purchasedDate,$serviceDate, $size, $upc, $damage), // Add the fields here.
      ) );
  
      $form['fields'][] = $product;
  
      return $form;
  }
  
  // Remove the field before the form is saved. Adjust your form ID
  add_filter( 'gform_form_update_meta_5', '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' =&gt; 1000 ), 'NOT' );
      }
  
      return $form_meta;
  }
  </code></pre>
  
  <p>I do need this field to be required somehow, specifically the first entry so that the user knows to enter at least one product. What am I missing?</p>