Skip to content
This repository has been archived by the owner on Jan 13, 2018. It is now read-only.

Commit

Permalink
v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kodie committed Oct 30, 2015
1 parent 9ed3959 commit 8dc8c6e
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 31 deletions.
10 changes: 10 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
v1.0.3 (10/30/2015)
- Fixed bug where repeated fields would look like they failed validation if any repeated fields before them failed.
- Fixed bug with validation on fields with multiple inputs.
- Fixed bugs with form editor and setting repeater children required option.
- Added beforeRepeat, afterRepeat, beforeUnRepeat, and AfterUnRepeat form triggers.
- Added a stylesheet with some default styles for repeater releated stuff.
- Added keypress event and tab index to add and remove buttons.
- Added a little bit of error handing to the javascript just in case the admin forgets to add a repeater-end or trys to nest repeaters.
- Repeater start field label now defaults to blank instead of "Untitled".

v1.0.2 (10/27/2015)
- Fixed bug where if any fields in a form with a repeater in it would be unsubmittable.
- Fixed repeater field validation.
Expand Down
4 changes: 2 additions & 2 deletions class-gf-field-repeater.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public static function gform_enqueue_scripts($form, $is_ajax) {
if (!empty($form)) {
if (in_array('GF_Field_Repeater', $form)) {
wp_enqueue_script('_gf_postcapture', plugins_url('js/jquery.postcapture.min.js', __FILE__), array('jquery'));
wp_enqueue_script('_gf_repeater', plugins_url('js/gf-repeater.min.js', __FILE__), array('jquery'), '1.0.2');
wp_enqueue_style('_gf_repeater', plugins_url('gf-repeater.css', __FILE__), array(), '1.0.2');
wp_enqueue_script('_gf_repeater', plugins_url('js/gf-repeater.min.js', __FILE__), array('jquery'), '1.0.3');
wp_enqueue_style('_gf_repeater', plugins_url('gf-repeater.css', __FILE__), array(), '1.0.3');
}
}
}
Expand Down
61 changes: 43 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ A Gravity Forms add-on that allows specified groups of fields to be repeated by

### Issues
* Not all fields are currently supported.
* Ajax enabled forms are not supported.
* Fields inside of a repeater will return a duplicated item with a blank result outside of the repeater when viewing an indiviual entry (These are only visible if "show empty fields" is checked).
* Fields inside of a repeater sometimes show a blank colum in the "entries" page. (These can be hidden by changing which columns to display by clicking the gear icon in the upper right-hand corner).

Expand Down Expand Up @@ -61,6 +62,15 @@ gfRepeater_setRepeater(repeaterId, timesX);
Repeats or unrepeats the repeater to get it to whatever timesX is.
```

##### Triggers
These triggers are assigned to the form will be fired during different repeater related events with the repeaterId and repeaterChildId attached to them.
```
beforeRepeat - Fires right before a repeater is about to be repeated.
afterRepeat - Fires right after a repeater has been repeated.
beforeUnRepeat - Fires right before a repeater is about to be un-repeated.
afterUnRepeat - Fires right after a repeater has been un-repeated.
```

##### Information
You can access all repeater information using the object `gfRepeater_repeaters`.
```
Expand Down Expand Up @@ -95,32 +105,47 @@ gfRepeater_repeaters
['defaultValue'] - The default value for the input.
```

##### 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(1, attendees);
})
```

Change the value of a field if the repeater is repeated or un-repeated:
```
jQuery('#gform_9').on('afterRepeat afterUnRepeat', function(event, repeaterId, repeaterChildId){
if (repeaterId == 1) {
var repeatCount = gfRepeater_repeaters[repeaterId]['data']['repeatCount'];
var totalPrice = 27.47 * repeatCount;
jQuery('#gform_9 #input_9_4').val('$'+totalPrice);
}
});
```


### Frequently Asked Questions
##### Can I use multiple repeaters in one form?
Yes!

##### Some of my repeated fields are showing they are required when they shouldn't be! What do I do?
If you experience any problems with required fields, follow the following steps for the field:

1. Uncheck the "Required" checkbox for the field.
1. Move the field outside of the repeater.
1. Make sure that the "Required" checkbox is still unchecked. If it's checked again, uncheck it.
1. Move the field back inside of the repeater.
1. If desired, make the field required again.
##### Can I nest repeaters?
Unfortunately nesting repeaters is not supported at this time.

### Version
1.0.2
1.0.3

### Changelog
##### 1.0.2
* Fixed bug where if any fields in a form with a repeater in it would be unsubmittable.
* Fixed repeater field validation.
* Added custom validation message feature.
* Added repeater "start" number feature.
* Added repeater label and description options.
* Added custom Add and Remove button HTML feature.
* Added "Do not use add and remove buttons" feature.
* Added new "[gfRepeater-count]" shortcode.
##### 1.0.3
* Fixed bug where repeated fields would look like they failed validation if any repeated fields before them failed.
* Fixed bug with validation on fields with multiple inputs.
* Fixed bugs with form editor and setting repeater children required option.
* Added beforeRepeat, afterRepeat, beforeUnRepeat, and AfterUnRepeat form triggers.
* Added a stylesheet with some default styles for repeater releated stuff.
* Added keypress event and tab index to add and remove buttons.
* Added a little bit of error handing to the javascript just in case the admin forgets to add a repeater-end or trys to nest repeaters.
* Repeater start field label now defaults to blank instead of "Untitled".

### Requirements
* Wordpress (duh)
Expand Down
23 changes: 14 additions & 9 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: KodieGrantham
Tags: gravity, forms, repeater
Requires at least: 3.0.1
Tested up to: 4.3.1
Stable tag: 1.0.2
Stable tag: 1.0.3

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

Expand Down Expand Up @@ -33,6 +33,7 @@ A Gravity Forms add-on that allows specified groups of fields to be repeated by

= Issues =
* Not all fields are currently supported.
* Ajax enabled forms are not supported.
* Fields inside of a repeater will return a duplicated item with a blank result outside of the repeater when viewing an indiviual entry (These are only visible if "show empty fields" is checked).
* Fields inside of a repeater sometimes show a blank colum in the "entries" page. (These can be hidden by changing which columns to display by clicking the gear icon in the upper right-hand corner).

Expand All @@ -52,14 +53,8 @@ You can place shortcodes inside of input labels, input descriptions, and HTML bl
= Can I use multiple repeaters in one form? =
Yes!

= Some of my repeated fields are showing they are required when they shouldn't be! What do I do? =
If you experience any problems with required fields, follow the following steps for the field:

1. Uncheck the "Required" checkbox for the field.
1. Move the field outside of the repeater.
1. Make sure that the "Required" checkbox is still unchecked. If it's checked again, uncheck it.
1. Move the field back inside of the repeater.
1. If desired, make the field required again.
= Can I nest repeaters? =
Unfortunately nesting repeaters is not supported at this time.

== Screenshots ==
1. Any supported fields placed between the `Repeater` and `Repeater End` will be repeated.
Expand All @@ -68,6 +63,16 @@ If you experience any problems with required fields, follow the following steps
4. A view of the front-end. The only visible difference will be the added `+` and `-` buttons.

== Changelog ==
= 1.0.3 =
* Fixed bug where repeated fields would look like they failed validation if any repeated fields before them failed.
* Fixed bug with validation on fields with multiple inputs.
* Fixed bugs with form editor and setting repeater children required option.
* Added beforeRepeat, afterRepeat, beforeUnRepeat, and AfterUnRepeat form triggers.
* Added a stylesheet with some default styles for repeater releated stuff.
* Added keypress event and tab index to add and remove buttons.
* Added a little bit of error handing to the javascript just in case the admin forgets to add a repeater-end or trys to nest repeaters.
* Repeater start field label now defaults to blank instead of "Untitled".

= 1.0.2 =
* Fixed bug where if any fields in a form with a repeater in it would be unsubmittable.
* Fixed repeater field validation.
Expand Down
4 changes: 2 additions & 2 deletions repeater.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms Repeater Add-On
Plugin URI: https://wordpress.org/plugins/repeater-add-on-for-gravity-forms/
Description: A Gravity Forms add-on that allows specified groups of fields to be repeated by the user.
Version: 1.0.2
Version: 1.0.3
Author: Kodie Grantham
Author URI: http://kodieg.com
*/
Expand All @@ -21,7 +21,7 @@ function gfrepeater_row_meta($links, $file) {
GFForms::include_addon_framework();

class GFRepeater extends GFAddOn {
protected $_version = "1.0.2";
protected $_version = "1.0.3";
protected $_min_gravityforms_version = "1.0.0";
protected $_slug = "repeateraddon";
protected $_path = "gravityforms-repeater/repeater.php";
Expand Down

0 comments on commit 8dc8c6e

Please sign in to comment.