GithubHelp home page GithubHelp logo

kodie / gravityforms-repeater Goto Github PK

View Code? Open in Web Editor NEW
59.0 16.0 58.0 604 KB

A Gravity Forms add-on that allows specified groups of fields to be repeated by the user.

PHP 42.03% JavaScript 55.27% CSS 2.69%
wordpress wordpress-plugin gravity-forms repeater plugin addon php javascript

gravityforms-repeater's Introduction

WAIT!

This plugin is no longer maintained and is probably broken, go use Gravity Forms Nested Forms by Gravity Wiz instead!

Gravity Forms Repeater Add-On

A Gravity Forms add-on that allows specified groups of fields to be repeated by the user. https://wordpress.org/plugins/repeater-add-on-for-gravity-forms/

Supported Fields

  • Address
  • Checkboxes
  • Date
  • Drop Down
  • Email
  • Hidden
  • HTML
  • MultiSelect
  • Name
  • Number
  • Paragraph Text
  • Phone
  • Radio
  • Section
  • Single Line Text
  • Time
  • Website

Features

  • Repeat groups of fields multiple times
  • Use multiple repeaters on the same form
  • Use shortcodes to display data to the user
  • Use Javascript to manipulate the repeater
  • Customize the add and remove button's HTML
  • Use Gravity Forms pre-populate hooks and filters like normal
  • Supports Conditional Logic!

Issues

  • Not all fields are currently supported.
  • Ajax enabled forms are not yet supported. (Ajax will be automatically disabled on forms with repeaters)

Shortcodes

You can place shortcodes inside of input labels, input descriptions, and HTML blocks!

  • [gfRepeater-count] - Will output the current repeat number.
  • [gfRepeater-buttons] - Will output both the '+' and '-' buttons.
  • [gfRepeater-add] - Will output the '+' button.
  • [gfRepeater-remove] - Will output the '-' button.

CSS Classes

You can use these CSS classes in the in the "Custom CSS Class" setting to do different things.

  • gf_repeater_hide_add - Will hide the '+' button if placed in the repeater end css setting.
  • gf_repeater_hide_remove - Will hide the '-' button if placed in the repeater end css setting.

Javascript

Functions

You can use Javascript to manipulate the repeater.

  • formId is your form's Id number assigned by Gravity Forms.
  • repeaterId will depened on how many repeaters you have in your form. (The first repeater's ID is 1, second is 2, etc.)
  • repeaterChildId works the same way and depends on how many times the repeater has been repeated.
  • These functions will not allow you to repeat more than the set max and unrepeat more than the set min.

// Repeats the repeater once.
gfRepeater_repeatRepeater(formId, repeaterId);
// Un-repeats the repeater once. repeaterChildId is optional.
gfRepeater_unrepeatRepeater(formId, repeaterId, repeaterChildId);
// Repeats the repeater a number of times.
gfRepeater_repeatRepeaterTimes(formId, repeaterId, timesX);
// UnRepeats the repeater a number of times.
gfRepeater_unrepeatRepeaterTimes(formId, repeaterId, timesX);
// Repeats or unrepeats the repeater to get it to whatever timesX is.
gfRepeater_setRepeater(formId, repeaterId, timesX);
// Selects an element depending on the variables passed. All variables are optional besides formId. inputId also accepts '*' to select all inputs.
gfRepeater_select(formId, repeaterId, repeatId, childId, inputId);
Triggers

These triggers are assigned to the form will be fired during different repeater related events with the repeaterId and repeaterChildId attached to them.

gform_repeater_before_repeat - Fires right before a repeater is about to be repeated.
gform_repeater_after_repeat - Fires right after a repeater has been repeated.
gform_repeater_before_unrepeat - Fires right before a repeater is about to be un-repeated.
gform_repeater_after_unrepeat - Fires right after a repeater has been un-repeated.
gform_repeater_init_done - Fires after the repeater is done setting up. Also fires on the window when all repeaters are done setting up.
Information

You can access all repeater information using the object gfRepeater_repeaters.

gfRepeater_repeaters
[formId]
    [repeaterId]
        ['data'] - Contains different data to keep track of.
            ['repeatCount'] - The number of times the repeater has been repeated.
            ['prevRepeatCount'] - If the form has already been submitted and failed validation, this will contain the repeatCount from before the from was submitted, otherwise it will be null.
            ['childrenCount'] - The number of children fields that get cloned everytime the repeater is repeated.
            ['paremCount'] - The highest field ID that has had their prepopulate paremeter set.
            ['tabIndex'] - The tabindex that was assigned to the repeater start field and will be assigned to all children.
            ['inputData'] - Contains an array with all of the input names in the repeater.
            ['startIdNum'] - ID Number of the repeater start field.
            ['endIdNum'] - ID Number of the repeater end field.
        ['settings'] - Contains the different settings that are set in the form editor.
            ['start'] - The number of times the repeater should be repeated when the form is loaded.
            ['min'] - The minimum number of times the repeater can be repeated.
            ['max'] - The maximum number of times the repeater can be repeated.
        ['controllers'] - Contains different elements that I like to call controllers.
            ['add'] - The add button.
            ['remove'] - The remove button.
            ['data'] - The hidden element that stores data to be passed to PHP.
            ['start'] - The start of the repeater.
            ['end'] - The end of the repeater.
        ['children'] - Contains the children fields that get cloned everytime the repeater is repeated.
            [childId]
                ['element'] - The field element.
                ['id'] - The field HTML id.
                ['idNum'] - The field ID number.
                ['inputCount'] - The number of inputs the child contains.
                ['inputMask'] - The field's input mask.
                ['required'] - True or False depeneding on if the field is required or not.
                ['type'] - The field type.
                ['inputs'] - Contains all of the inputs that the child contains.
                    [inputId]
                        ['element'] - The input element.
                        ['id'] - The input HTML id.
                        ['name'] - The input name.
                        ['defaultValue'] - The default value for the input.
                        ['prePopulate'] - Array containing prepopulate values.
Usage Examples

Repeat the repeater a number of times depending on the value of a drop down field:

jQuery('#gform_6 #input_6_7').change(function(){
    var attendees = jQuery(this).val();
    gfRepeater_setRepeater(6, 1, attendees);
});

Change the value of a field if the repeater is repeated or un-repeated:

jQuery('#gform_9').on('gform_repeater_after_repeat gform_repeater_after_unrepeat', function(event, repeaterId, repeatId){
    if (repeaterId == 1) {
        var repeatCount = gfRepeater_repeaters[9][1]['data']['repeatCount'];
        var totalPrice = 27.47 * repeatCount;
        jQuery('#gform_9 #input_9_4').val('$'+totalPrice);
    }
});

Prepopulate Fields

You can set Parameter Names to prepopulate repeated fields like usual with the added ability to specify which repeated set will be prepopulated. For example, let's say we have set the parameter name for one of our repeated fields to "parem":

?parem=hello+world will result in that field being set to "hello world" regardless of how many times it has been repeated.

?parem3=hello+world will result in that field being set to "hello world" only when repeated a third time.

You can use filters as well!

add_filter( 'gform_field_value_parem', 'your_function_name' );
add_filter( 'gform_field_value_parem3', 'your_function_name' );

Also, setting the prepopulate parameter on the repeater start field will override the start setting.

Frequently Asked Questions

Can I use multiple repeaters in one form?

Yes!

Can I nest repeaters?

Unfortunately nesting repeaters is not supported at this time.

Can I change the + and - buttons to text links?

Yes! Just go to the form editor and change the Add HTML and Remove HTML settings to <a>Your Link Text</a> and they should appear as regular links on your form!

Development

Method 1 (Automatic Updates)

It is possible to use the development version of this plugin in your Wordpress install and keep it updated with Andy Fragen's GitHub Updater!

  1. Download & Install GitHub Updater.
  2. Go to Settings -> GitHub Updater.
  3. Enable Branch Switching.
  4. Go to Plugins.
  5. Select "try another branch" under Gravity Forms Repeater Add-On.
  6. Select "development".

and that's it! You will recieve the latest development versions of this plugin!

Method 2 (Manual)
  1. Deactivate & Uninstall current version of Gravity Forms Repeater Add-On.
  2. Download the latest development version.
  3. Go to Plugins.
  4. Select "Add New".
  5. Select "Upload Plugin".
  6. Select "Choose File" and find the zip file that you downloaded in step 2.
  7. Select "Install Now".

and you're good to go!

Warning: There is a slight possibility that development versions are unstable. Use at your own risk.

Version

1.0.9

Changelog

1.0.9
  • Fixed bug where in some cases a PHP error would occur when attempting to automatically disable ajax on a form.
  • Fixed bug where sometimes a javascript error would occur on date fields with a calendar icon.
  • Fixed bug where removing a specific repeatId would cause some weird things to happen.
  • Fixed bug where repeaters in a multipage form that are not on the first page would appear to have failed validation even if the form hasn't been submitted.
  • Fixed bug where repeaters in a muttipage form that are not on the first page would forget their saved data and ignore their start setting.
  • Fixed hideButtons setting.
  • Added [gfRepeater-buttons], [gfRepeater-add], and [gfRepeater-remove] shortcodes.
  • Added custom CSS option to repeater start and end fields.
  • Added gf_repeater_hide_add and gf_repeater_hide_remove CSS classes.
  • Added gfRepeater_select javascript function.
  • Added 'gform_repeater_init_done' trigger to window and individual forms.
  • Changed 'beforeRepeat', 'afterRepeat', 'beforeUnRepeat', and 'afterUnRepeat' triggers to 'gform_repeater_before_repeat', 'gform_repeater_after_repeat', 'gform_repeater_before_unrepeat', and 'gform_repeater_after_unrepeat'.
  • Repeated fields now respect conditional logic from outside the repeater.
  • Applying conditional logic on a repeated section field now also applys that logic on repeated fields under that section.
  • When exporting entries, repeater child data is now exported in a comma-separated list.

Requirements

  • Wordpress 3.9 or later
  • Gravity Forms 1.9 or later

Installation

  1. Upload the repeater-add-on-for-gravity-forms folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.

gravityforms-repeater's People

Contributors

bostondv avatar hostedpixel avatar jmslbam avatar kodie avatar marwzoor avatar rcooler avatar robertstaddon avatar webimage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gravityforms-repeater's Issues

warning text appears on submission

Everytime I submit a form I get an error message that displays on the confirmation page. The form goes through but displays this code at the top:

Warning: substr() expects parameter 1 to be string, array given in /home3/sjgas/public_html/contractorsonly/wp-content/plugins/repeater-add-on-for-gravity-forms/class-gf-field-repeater.php on line 143

Can you lend any insight as to why this is happening?

Show as many repeated instances as there is pre-populated data

Right now even if I pass pre-populate data for a repeater to be repeated multiple times it only repeats once.

Eg. if I have input1=asdf&input2=qwer&input3=zxcv

When I click the plus button to add additional repeater sections the pre-populated data shows up in the new sections.

One of the most common use cases for pre-populating data is probably for users to re-edit data they've entered previously. In such a case, the user will expect to see the data they entered initially. If I pass in pre-populate data, I think it should show up on the screen.

Why does gfRepeater_getChoiceValue return a label instead of a value?

Seems like this code:

var id = this.id;
var label = jQuery(this).siblings('label').first().text();
value.push(label);

Should just be:

value.push(jQuery(this).val());

The value and label will typically be the same, unless the user checks the "show values" checkbox. I believe that checking the value is the correct thing to do and should always work.

should_be_value_maybe

Exporting.

When I export a form's entries in to Excel any data that was in a repeater field is all placed in a single cell. How do I export to Excel allowing the data in the repeater field to appear in the corresponding separate rows?

Feature Request: A way to distinguish which input a value came from in multi-input fields

I've got some name and address fields in a repeater. if a user doesn't fill out one of the optional name or address parts (eg. Name Suffix, or Address Line 2) then those empty values don't get included in the serialized string that's stored with the form.

When trying to de-serialize these values to pre-populate or otherwise use the values, this results in ambiguity about which input a value corresponds to.

It would be convenient if the serialized string preserved the input name somehow.

See the attached screenshot for a visual explanation.

Eg.
seriialized_values

How can I pre-populate some repeater entries?

Is there a built-in way to pre-populate the repeater with some data?

It's working really well for submitting data on the site I'm building, now I'd like to add the ability for users to edit entries they've made previously.

I'd prefer to do it server-side, but it looks like if there's no baked-in method, then I could pass my values to the client with wp_localize_script, then use gfRepeater_setRepeater and populate the values manually with JavaScript....but, if there's a shortcut that'd be nice.

Price Field inside repeater loses Currency option

Hello, I try to use repeater to make a register of a delivery, but this plugin not work in price field corretly... please make a review on this...

the currency when i set a numer field as currency it put the signals of current currency in the value, when this fiels inside repeater this not work, and a number field with calculation not recongnise this field anymore....

Thanks for any help...

tabindex="NaN" when gform_tabindex is false

Hi Kodie,
Thank you for this outstanding plugin, very useful!

I found the following issue:
For every GF I add add_filter( 'gform_tabindex', '__return_false' ); to disable the tab-indexes.

I noticed that this displays in the HTML as tabindex="NaN"

For example in
<select name="input_4-1-1" id="input_2_4-1-1" onchange="gf_apply_rules(2,[9,10]);" class="medium gfield_select" data-repeater-inputid="1" tabindex="NaN">

Best would to remove the tabindex attribute completely when gform_tabindex is false.

Kind regards,
RIan Rietveld

Uncaught TypeError: Cannot read property 'required' of undefined

Everything was working fine with the plugin (Which is clutch, by the way. Super helpful) until I added some conditional logic and this JS error broke the entire form. The form now has an inline display: none applied to it.

The culprit seems to be this line:
if (childInfo['required']) { childRequired = true; }

Conditionial logica

Hi,

Is it possible to add conditionial logica to the repeater? because now the sub items of a logica arent visible but the trigger button is :(

Conditional Fields and the Repeater

Hi, I'm unsure if this is covered elsewhere, but when I use the plugin to repeat a group of fields with conditional logic, the hidden fields no longer show given the proper condition.

Conditional sections don't hide fields inside section

The GF way of doing sections is kind of weird, since there's no actual nesting, but all fields after a section are considered to be part of the section until the next section or page starts.

Outside of repeaters, conditionally hiding a section will hide all fields inside that section.

Inside a repeater just the section header itself seems to be hidden, the subsequent fields are still shown.

Conditional logic in the repeater works for all repeats

I've got a section (image below, section is called Practitioner Details (delegates)) in a repeater that should only show if a radio button is selected as yes:

screen shot 2016-04-13 at 9 46 07 am

Once there's a few repeats, you'll get mixes of "yes" and "no" selections. As soon as there is one "yes" selection all of the sections are enabled.

screen shot 2016-04-13 at 9 45 52 am

This is using the latest dev version.

Raw Email Data Output

Hi Kodie,
I seem to have encountered another issue with the plugin :-/

I am trying to generate a Raw Text Email, but it seems the plugin does not support this. Here is my Notification code, with Autoformatting disabled:

xxx {[Field Name]:[field_id]}
Single Line: {Single Line:1}
{Repeater:6}
Paragraph: {Paragraph:2}
Radio: {Radio:3}
{Untitled:7}
List: {List:4:}
Col: {Column List:5:}
File: {File:8}

I'm using a filter to generate text emails:

// Set Gravity Forms to text Emails
add_filter( 'gform_notification', 'change_notification_format', 10, 3 );
function change_notification_format( $notification, $form, $entry ) {

    // change notification format to text from the default html
    $notification['message_format'] = 'text';

    return $notification;
}

Emails arrive like this:

xxx {[Field Name]:[field_id]}
Single Line: dsaad
a:2:{i:1;a:2:{i:2;a:1:{i:0;s:5:"sddsa";}i:3;a:1:{i:0;s:5:"Other";}}i:2;a:2:{i:2;a:1:     {i:0;s:13:"dasdsaasdsads";}i:3;a:1:{i:0;s:5:"other";}}}
 Paragraph:  
Radio: 

List: sdads
Col: sad,ads,dsa
File:

Pre-populating checkboxes

Hi Kodie,

Could you please test or document how pre-populating checkboxes should work?

I can't figure out how to get them to pre-populate.

If it matters, I'm trying to get them to pre-populate on pages 1 and 2 of a multi-page form (two repeaters, one on page on, one on page 2, each with a checkbox field).

Thanks,
Michael Moore

Errors after update

Hi Kodie,

after update your plugin I get the following errors:

Notice: Undefined offset: 0 in /Applications/MAMP/htdocs/grell_neu/wp-content/plugins/repeater-add-on-for-gravity-forms/class-gf-field-repeater.php on line 512

Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/grell_neu/wp-content/plugins/repeater-add-on-for-gravity-forms/class-gf-field-repeater.php on line 556

I'll get these errors on a form which is not using your repeater plugin! On the form which is using your plugin are no errors.

Use of GF-Repeater and CFDB

Hi Kodie,
I am trying to produce a formatted table of entries from a GF which has both non-repeated fields and repeated fields. The data for the repeated fields seems to be stored in the Wordpress database in an encoded form ["# id, lead_id, form_id, field_number, value
'3', '1', '1', '1', 'a:1:{i:1;a:4:{i:9;a:1:{i:0;s:4:"1234";}i:10;a:1:{i:0;s:22:"Where Your Treasure Is";}i:14;a:0:{}i:15;a:0:{}}}'] in table wp_rg_lead_detail. Do you know of any way I can produce a sub-table with this repeated data expanded into columns with the correct headers.
Any working examples would be greatly appreciated,
Cheers.

Repeater fields are not displaying in notification emails

I created a few repeater fields but when I receive a notification email, none of the fields are showing up. Currently I have the notification message using the {all_fields} shortcode. Is there something different I need to do to get repeater fields to show?

Uncaught TypeError: jQuery(...).mask is not a function

First of all thanks for the plugin, it seems awesome. But I'm not able to test it already because I got the following error:

Uncaught TypeError: jQuery(...).mask is not a function

Thanks already! Best Regards,
Nick

New form displaying repeater values from previous entry

Sometimes when going back to the form after submitting an entry the repeater fields are pre-populated with the values which were submitted with the previous entry.

I'm using a simple repeater with a single line text input within it.

For example, if I submit the form with 3 repetitions of the input with values "one", "two", "three" the next time I load the form those 3 values will be pre populated in the the new form rather than being an empty repeater. If I reload the page the repeated is cleared to its default empty values.

Is there somewhere in the browser cache or database which stores repeater data which might not be getting cleared after the first form submission?

Thanks!

Do I need an extra library for jQuery().mask?

I'm getting errors "jQuery(...).mask is not a function" on gf-repeater.js, line 254.

Do I need to install an extra jQuery library for that to work or is it likely that I've broken something else locally? I'm using gravityforms-repeater Version 1.0.8.

Conditional field has to be inside of repeater

I have a section inside of the repeater which I only want to show if a field, which is outside of the repeater has a certain value.

It seems that the conditional logic checks only allow me to pick fields inside the repeater, otherwise the form fails to render with the message: "child is undefined".

Repeater Fields causes errors on Gravity Form

Whenever I add a repeater field into a form, the form starts getting "messed up"... and the repeater buttons don't even work (tried in both preview mode and on the rendered form).

For example, the progress bar starts showing up on my multipage form, when I set it back to "steps" and save the form, it switches back to progress bar and doesn't save changes to the form. There are a couple other small quirks too but overall the repeater plugin basically breaks my form. When I disable the repeater plugin, things go back to normal.

There are no javascript errors showing up either. Have you seen this kind of behavior before? Would really like to get the repeater field working and it looks like a great plugin other than this. Thanks for your help!

Feature Request: Hidden field support

Hi Kodie,

Thanks for the nice plugin. Are hidden fields supported? They're not on the list of supported field types but should be able to be handled in a very similar fashion to regular input fields.

Thanks,
Michael Moore

Product Field Support

While I recognize that product fields are missing from your supported fields list, I would like to help make them supported if at all possible.

Have you looked into the issue before? Do you have a suggested starting place?

No time rush on this, I'm just interested in contributing :)

Arry shows in email

Hi,

When get the values in the notification email it looks like the image i attach. The Array are visible in the email before the tables where the value is. Anyone know what the problem is? It worked before but when i updated wordpress and gravityforms to the latest version i starting to get this error.
skarmavbild 2016-05-04 kl 09 59 46

Date fields with input type Date Field have same ID

Date fields have three options for user input.

  • Date Field shows individual fields for Month/Day/Year
  • Date Picker shows a calendar popup for a single field
  • Date Drop Down shows three M/D/Y drop down fields.

If I use Date Field or Date Drop Down then all date input field parts get the same ID

The Month field has "input_3_3_1-1-1" and the Day field has "input_3_3_1-1-1" and the year field has "input_3_3_1-1-1".

Worse, add more entries to the repeater, the additional date fields continue to have the same "input_3_3_1-1-1" ID, even if they are in repeated group 2, 3, etc.

To repeat:

Create a repeater with a date field using Date Field or Date Drop Down and inspect the generated HTML. Click the plus to add repeated entries in your repeater. Inspect the generated HTML.

Conditional Open/Close Blocks

If would be useful if the opening and closing blocks themselves could be shown/hidden conditionally, in instances where you don't want to allow people to add any items.

Multi Page forms seem to be broken

Hi,
I have a large multi page form. It seems the the repeater addon breaks the multi page functionality (can't navigate to the previous/next page via buttons. Have to hit enter in a field to switch to the next page). I also get some javascript error from the plugin in jquery.postcaputer.min.js:

'''
Uncaught TypeError: Cannot read property 'length' of undefined
'''

Would be great if you knew how to fix it....

Regression between 1.0.8 and 1.0.9 on multi-page forms

Hi!

I've got a multi-page form with a repeater on page 1.

When I submit my form using plugin version 1.0.8 the data saves correctly, but in version 1.0.9 I get empty values. Interestingly, it does show the correct number of empty values, just not the values themselves.

The form I'm testing this on is extremely simple. Page one is just a repeater with a single text field in it. Page two has a text field and a radio button.

submitted_with_version_1 0 8
submitted_with_version_1 0 9

Thanks!

radio buttons inside repeaters loses value

I noticed the radio fields inside a repeater loses the selected value when inside of a page, and using the "previous page" button.

when I duplicate the same field and move it out of the repeater, it works fine.
im using this component for a a project at work... would be awesome if you could fix it... its a bit of a show stopper for us.

Thanks

JS error when you have a required date field with a calendar icon

I'm getting error messages in gf-repeater.js on line 290

 if (childRequired) {
    var splitName = newInputName.replace('.', '_').split(/(_|-)/);

newInputName is undefined.

It looks like this is only happening when you have a required date field which has an icon (calendar or custom) set. It seems that the icon image URL is put in a hidden field which has no name property.

This results in inputId having a value, but inputName being undefined on lines 227/228, then since the date field is required, gf-repeater.js tries to split the undefined newInputName.

It seems that that this only causes an actual problem sometimes. One of my forms won't advance to the next page because of the error, but another one of my forms will. Both are multi-page and neither are using ajax. The error shows up in the console in both cases. I haven't figured out what's different between the two forms. For the time being I just edited gf-repeater.js to check if(newInputName && childRequired).

php 5.6.10 breaks the /wp-admin/plugins.php page

hello, when I have php 5.6.10 activated the plugin creates a weird bug...

when on my wp-admin / plugin list page /wp-admin/plugins.php, the list breaks when getting to this plugin item. the list stops to display so I can't see plugins that are alphabetically after this one.

downgrading my php version to 5.5.26 resolves the bug.

on 5.6, the plugin still works but its really annoying that I cant manage plugins from the admin when this one is active. there is no php errors in my logs...

im in development phase right now so I can easely switch php versions, but it wont be so easy next week when we put the site online...

Please let me know if you have a solution for the plugin to work with ulterior versions of php.

thanks

Undefined index: conditionalLogic

Small issue that is throwing a notice.

I have disabled ajax on the form as instructed and I have noticed that if I add custom Add and remove markup to the 'Repeater End' it throws a bunch of 'Undefined Index: conditionalLogic' notices when I click the Add button.

the html I have added to each is
<button class="btn btn--tiny btn--primary">Add Another Timesheet</button>
and
<button class="btn btn--tiny btn--secondary">Remove Timesheet</button>.

Without custom code in there it works without error.

Allow Zero Repetitions / Items

It should be possible to start with / allow a minimum of zero instances of a repeated section. In my case I ask for employment history, and require certain fields like date hired / left for each instance. Users without an employment history will be unable to fill out this form. I was able to work around this constraint by adding another field ("Have you been employed before?") and making all of the fields in the repeated section conditional, but that is cumbersome to manage and imposes constraints on the kind of conditional logic that can be used in the repeated fields.

Lists and File Fields

I don't see these types in your list of supported fields, so I believe this is why they don't work. The file field doesn't allow for file upload and the button doesn't work.

The list field works on the frontend but the submission within email is garbage and gets chopped off.

Can you confirm these issues?

Issue with jQuery.captures and Page type confirmations

I've got a series of forms that are chained together. It's a several-hundred question scholarship application process, so each section is a form. Upon completion of one form the user is sent directly to the next form using the Gravity Forms Page type confirmation.

It seems that at least in a page type confirmation the jQuery.captures data is not cleared so values typed in one form overwrite values in a subsequent form if the field names match.

I have worked around this issue by appending an additional hidden field to the form which holds the formId. During initialization if the jQuery.captures formId doesn't match the current form ID, gfRepeater_submitted is not set to true.

// Initiation right away
jQuery(document).ready(function($) {
    gfRepeater_patchMask();
    var theForm = jQuery('.gform_wrapper form');
    var formId = jQuery('.gform_wrapper form').attr('id');
    theForm.append('<input type="hidden" name="the_hidden_form_id" value="' + formId + '">');
    theForm.capture();
    if (jQuery.captures()) { 
        // check if it's the same form
        if(jQuery.captures('the_hidden_form_id') == formId){
            gfRepeater_submitted = true; 
        }else{
            // console.log("Found old data, not counting as submitted");
        }
    }
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.