Formidable Forms – Form Builder for WordPress - Version 3.02

Version Description

  • New: Add support for WordPress export and erase personal data options for easier GDPR support
  • Fix: HTML was getting stripped in field labels when a form was edited on the form builder page
  • Fix: If a field option includes HTML, allow the HTML rather than sanitizing it with entities
  • Fix: When the 'add option' button on the form builder is clicked multiple times, add the options correctly if the previous option isn't yes showing in the form maker
  • Fix: The HTML for the link to the user profile was showing in the sidebar when editing or viewing an entry
  • Code change: Move input classes into the field object class so it can be more easily overridden and amended. The FrmFieldType->get_input_class() function can be overriden in sub classes
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 3.02
Comparing to
See all releases

Code changes from version 3.01.03 to 3.02

classes/controllers/FrmAppController.php CHANGED
@@ -239,6 +239,8 @@ class FrmAppController {
239
  * @since 2.0.1
240
  */
241
  public static function admin_init() {
 
 
242
  if ( ! FrmAppHelper::doing_ajax() && self::needs_update() ) {
243
  self::network_upgrade_site();
244
  }
239
  * @since 2.0.1
240
  */
241
  public static function admin_init() {
242
+ new FrmPersonalData(); // register personal data hooks
243
+
244
  if ( ! FrmAppHelper::doing_ajax() && self::needs_update() ) {
245
  self::network_upgrade_site();
246
  }
classes/controllers/FrmFormsController.php CHANGED
@@ -1185,6 +1185,7 @@ class FrmFormsController {
1185
  } else if ( self::user_has_permission_to_view( $form ) ) {
1186
  $form = do_shortcode( $frm_settings->login_msg );
1187
  } else {
 
1188
  $form = self::get_form( $form, $title, $description, $atts );
1189
 
1190
  /**
@@ -1226,7 +1227,7 @@ class FrmFormsController {
1226
  }
1227
 
1228
  public static function get_form( $form, $title, $description, $atts = array() ) {
1229
- ob_start();
1230
 
1231
  do_action( 'frm_before_get_form', $atts );
1232
 
1185
  } else if ( self::user_has_permission_to_view( $form ) ) {
1186
  $form = do_shortcode( $frm_settings->login_msg );
1187
  } else {
1188
+ do_action( 'frm_pre_get_form', $form );
1189
  $form = self::get_form( $form, $title, $description, $atts );
1190
 
1191
  /**
1227
  }
1228
 
1229
  public static function get_form( $form, $title, $description, $atts = array() ) {
1230
+ ob_start();
1231
 
1232
  do_action( 'frm_before_get_form', $atts );
1233
 
classes/helpers/FrmAppHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '3.01.03';
15
 
16
  /**
17
  * @since 1.07.02
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '3.02';
15
 
16
  /**
17
  * @since 1.07.02
classes/helpers/FrmCSVExportHelper.php CHANGED
@@ -13,6 +13,7 @@ class FrmCSVExportHelper {
13
  protected static $headings = array();
14
  protected static $fields = array();
15
  protected static $entry;
 
16
 
17
  public static function csv_format_options() {
18
  $formats = array( 'UTF-8', 'ISO-8859-1', 'windows-1256', 'windows-1251', 'macintosh' );
@@ -27,6 +28,7 @@ class FrmCSVExportHelper {
27
  self::$fields = $atts['form_cols'];
28
  self::$form_id = $atts['form']->id;
29
  self::set_class_paramters();
 
30
 
31
  $filename = apply_filters( 'frm_csv_filename', date( 'ymdHis', time() ) . '_' . sanitize_title_with_dashes( $atts['form']->name ) . '_formidable_entries.csv', $atts['form'] );
32
  unset( $atts['form'], $atts['form_cols'] );
@@ -68,6 +70,10 @@ class FrmCSVExportHelper {
68
  self::$column_separator = apply_filters( 'frm_csv_column_sep', $col_sep );
69
  }
70
 
 
 
 
 
71
  private static function print_file_headers( $filename ) {
72
  header( 'Content-Description: File Transfer' );
73
  header( 'Content-Disposition: attachment; filename="' . esc_attr( $filename ) . '"' );
@@ -131,6 +137,13 @@ class FrmCSVExportHelper {
131
  $headings['ip'] = __( 'IP', 'formidable' );
132
  $headings['id'] = __( 'ID', 'formidable' );
133
  $headings['item_key'] = __( 'Key', 'formidable' );
 
 
 
 
 
 
 
134
  }
135
 
136
  private static function prepare_next_csv_rows( $next_set ) {
@@ -252,6 +265,9 @@ class FrmCSVExportHelper {
252
  $row['ip'] = self::$entry->ip;
253
  $row['id'] = self::$entry->id;
254
  $row['item_key'] = self::$entry->item_key;
 
 
 
255
  }
256
 
257
  private static function print_csv_row( $rows ) {
13
  protected static $headings = array();
14
  protected static $fields = array();
15
  protected static $entry;
16
+ protected static $has_parent_id;
17
 
18
  public static function csv_format_options() {
19
  $formats = array( 'UTF-8', 'ISO-8859-1', 'windows-1256', 'windows-1251', 'macintosh' );
28
  self::$fields = $atts['form_cols'];
29
  self::$form_id = $atts['form']->id;
30
  self::set_class_paramters();
31
+ self::set_has_parent_id( $atts['form'] );
32
 
33
  $filename = apply_filters( 'frm_csv_filename', date( 'ymdHis', time() ) . '_' . sanitize_title_with_dashes( $atts['form']->name ) . '_formidable_entries.csv', $atts['form'] );
34
  unset( $atts['form'], $atts['form_cols'] );
70
  self::$column_separator = apply_filters( 'frm_csv_column_sep', $col_sep );
71
  }
72
 
73
+ private static function set_has_parent_id( $form ) {
74
+ self::$has_parent_id = $form->parent_form_id > 0;
75
+ }
76
+
77
  private static function print_file_headers( $filename ) {
78
  header( 'Content-Description: File Transfer' );
79
  header( 'Content-Disposition: attachment; filename="' . esc_attr( $filename ) . '"' );
137
  $headings['ip'] = __( 'IP', 'formidable' );
138
  $headings['id'] = __( 'ID', 'formidable' );
139
  $headings['item_key'] = __( 'Key', 'formidable' );
140
+ if ( self::has_parent_id() ) {
141
+ $headings['parent_id'] = __( 'Parent ID', 'formidable' );
142
+ }
143
+ }
144
+
145
+ private static function has_parent_id() {
146
+ return self::$has_parent_id;
147
  }
148
 
149
  private static function prepare_next_csv_rows( $next_set ) {
265
  $row['ip'] = self::$entry->ip;
266
  $row['id'] = self::$entry->id;
267
  $row['item_key'] = self::$entry->item_key;
268
+ if ( self::has_parent_id() ) {
269
+ $row['parent_id'] = self::$entry->parent_item_id;
270
+ }
271
  }
272
 
273
  private static function print_csv_row( $rows ) {
classes/models/FrmPersonalData.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FrmPersonalData {
4
+
5
+ private $limit = 200;
6
+
7
+ private $page = 1;
8
+
9
+ public function __construct() {
10
+ add_filter( 'wp_privacy_personal_data_erasers', array( $this, 'register_data_eraser' ) );
11
+ add_filter( 'wp_privacy_personal_data_exporters', array( $this, 'register_exporter' ) );
12
+ }
13
+
14
+ /**
15
+ * Add options to the WordPress personal data exporter
16
+ *
17
+ * @since 3.02
18
+ * @param array $exporters
19
+ * @return array
20
+ */
21
+ public function register_exporter( $exporters ) {
22
+ $exporters['formidable-exporter'] = array(
23
+ 'exporter_friendly_name' => __( 'Formidable Forms Exporter', 'formidable' ),
24
+ 'callback' => array( $this, 'export_data' ),
25
+ );
26
+ return $exporters;
27
+ }
28
+
29
+ /**
30
+ * Add options to the WordPress personal data eraser
31
+ *
32
+ * @since 3.02
33
+ * @param array $erasers
34
+ * @return array
35
+ */
36
+ public function register_data_eraser( $erasers ) {
37
+ $erasers['formidable-eraser'] = array(
38
+ 'eraser_friendly_name' => __( 'Formidable Forms entries' ),
39
+ 'callback' => array( $this, 'erase_data' ),
40
+ );
41
+
42
+ return $erasers;
43
+ }
44
+
45
+ public function export_data( $email, $page = 1 ) {
46
+ $this->page = absint( $page );
47
+
48
+ $data_to_export = array(
49
+ 'data' => array(),
50
+ 'done' => true,
51
+ );
52
+
53
+ $entries = $this->get_user_entries( $email );
54
+ if ( empty( $entries ) ) {
55
+ return $data_to_export;
56
+ }
57
+
58
+ foreach ( (array) $entries as $entry ) {
59
+ $data_to_export['data'][] = array(
60
+ 'group_id' => 'formidable',
61
+ 'group_label' => __( 'Form Submissions', 'formidable' ),
62
+ 'item_id' => esc_attr( 'entry-' . $entry ),
63
+ 'data' => $this->prepare_entry_data( $entry ),
64
+ );
65
+ }
66
+
67
+ $data_to_export['done'] = count( $entries ) < $this->limit;
68
+ return $data_to_export;
69
+ }
70
+
71
+ /**
72
+ * @return array
73
+ */
74
+ public function erase_data( $email, $page = 1 ) {
75
+ $data_removed = array(
76
+ 'items_removed' => false,
77
+ 'items_retained' => false,
78
+ 'messages' => array(),
79
+ 'done' => true,
80
+ );
81
+
82
+ if ( empty( $email ) ) {
83
+ return $data_removed;
84
+ }
85
+
86
+ $this->page = absint( $page );
87
+ $entries = $this->get_user_entries( $email );
88
+ if ( empty( $entries ) ) {
89
+ return $data_removed;
90
+ }
91
+
92
+ // TODO: Add an option to anonymize the entries with wp_privacy_anonymize_data( 'email', 'e@e.com' );
93
+
94
+ foreach ( (array) $entries as $entry ) {
95
+ $removed = FrmEntry::destroy( $entry );
96
+
97
+ if ( $removed ) {
98
+ $data_removed['items_removed'] = true;
99
+ } else {
100
+ $data_removed['items_retained'] = true;
101
+ }
102
+ }
103
+
104
+ $data_removed['done'] = count( $entries ) < $this->limit;
105
+
106
+ return $data_removed;
107
+ }
108
+
109
+ /**
110
+ * Get all entries that were submitted by this user while logged in,
111
+ * or with a field value that matches the email address
112
+ *
113
+ * @param string $email
114
+ * @return array of entry ids
115
+ */
116
+ private function get_user_entries( $email ) {
117
+ $query_args = array(
118
+ 'order_by' => 'item_id ASC',
119
+ 'limit' => $this->get_current_page(),
120
+ );
121
+
122
+ $user = get_user_by( 'email', $email );
123
+ $entries_by_email = FrmDb::get_col( 'frm_item_metas', array( 'meta_value' => $email ), 'item_id', $query_args );
124
+
125
+ if ( empty( $user ) ) {
126
+ // no matching user, so return the entry ids we have
127
+ return $entries_by_email;
128
+ }
129
+
130
+ $query_args['order_by'] = 'id ASC';
131
+
132
+ $entries_by_user = FrmDb::get_col( 'frm_items', array( 'user_id' => $user->ID ), 'id', $query_args );
133
+
134
+ $entry_ids = array_merge( (array) $entries_by_user, (array) $entries_by_email );
135
+ $entry_ids = array_unique( array_filter( $entry_ids ) );
136
+ return $entry_ids;
137
+ }
138
+
139
+ private function get_current_page() {
140
+ $start = ( $this->page - 1 ) * $this->limit;
141
+ return FrmDb::esc_limit( $start . ',' . $this->limit );
142
+ }
143
+
144
+ /**
145
+ * @param int $entry
146
+ * @return array
147
+ */
148
+ private function prepare_entry_data( $entry ) {
149
+ $entry = FrmEntry::getOne( $entry, true );
150
+
151
+ $entry_data = array();
152
+ foreach ( $entry->metas as $field_id => $meta ) {
153
+ $field = FrmField::getOne( $field_id );
154
+
155
+ $entry_data[] = array(
156
+ 'name' => $field->name,
157
+ 'value' => FrmFieldsHelper::get_unfiltered_display_value( array(
158
+ 'field' => $field,
159
+ 'value' => $meta,
160
+ ) ),
161
+ );
162
+ }
163
+
164
+ return $entry_data;
165
+ }
166
+ }
classes/models/fields/FrmFieldType.php CHANGED
@@ -471,6 +471,36 @@ DEFAULT_HTML;
471
  return ' frm_primary_label';
472
  }
473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
474
  /**
475
  * @param array $args
476
  * @param array $shortcode_atts
@@ -701,6 +731,8 @@ DEFAULT_HTML;
701
  }
702
 
703
  protected function get_field_input_html_hook( $field ) {
 
 
704
  ob_start();
705
  do_action( 'frm_field_input_html', $field );
706
  $input_html = ob_get_contents();
471
  return ' frm_primary_label';
472
  }
473
 
474
+ /**
475
+ * Add classes to the input for output
476
+ *
477
+ * @since 3.02
478
+ */
479
+ protected function add_input_class() {
480
+ $input_class = FrmField::get_option( $this->field, 'input_class' );
481
+ $extra_classes = $this->get_input_class();
482
+ if ( ! empty( $extra_classes ) ) {
483
+ $input_class .= ' ' . $extra_classes;
484
+ }
485
+
486
+ if ( is_object( $this->field ) ) {
487
+ $this->field->field_options['input_class'] = $input_class;
488
+ } else {
489
+ $this->field['input_class'] = $input_class;
490
+ }
491
+
492
+ return $input_class;
493
+ }
494
+
495
+ /**
496
+ * Add extra classes on front-end input
497
+ *
498
+ * @since 3.02
499
+ */
500
+ protected function get_input_class() {
501
+ return '';
502
+ }
503
+
504
  /**
505
  * @param array $args
506
  * @param array $shortcode_atts
731
  }
732
 
733
  protected function get_field_input_html_hook( $field ) {
734
+ $field['input_class'] = $this->add_input_class();
735
+
736
  ob_start();
737
  do_action( 'frm_field_input_html', $field );
738
  $input_html = ob_get_contents();
classes/views/frm-entries/sidebar-shared.php CHANGED
@@ -43,14 +43,24 @@
43
  <?php if ( $entry->user_id ) { ?>
44
  <div class="misc-pub-section">
45
  <span class="dashicons dashicons-admin-users wp-media-buttons-icon"></span>
46
- <?php printf( esc_html__( 'Created by: %1$s', 'formidable' ), esc_html( FrmFieldsHelper::get_user_display_name( $entry->user_id, 'display_name', array( 'link' => true ) ) ) ); ?>
 
 
 
 
 
47
  </div>
48
  <?php } ?>
49
 
50
  <?php if ( $entry->updated_by && $entry->updated_by != $entry->user_id ) { ?>
51
  <div class="misc-pub-section">
52
  <span class="dashicons dashicons-admin-users wp-media-buttons-icon"></span>
53
- <?php printf( esc_html__( 'Updated by: %1$s', 'formidable' ), esc_html( FrmFieldsHelper::get_user_display_name( $entry->updated_by, 'display_name', array( 'link' => true ) ) ) ); ?>
 
 
 
 
 
54
  </div>
55
  <?php } ?>
56
  <?php } ?>
43
  <?php if ( $entry->user_id ) { ?>
44
  <div class="misc-pub-section">
45
  <span class="dashicons dashicons-admin-users wp-media-buttons-icon"></span>
46
+ <?php
47
+ printf(
48
+ esc_html__( 'Created by: %1$s', 'formidable' ),
49
+ FrmAppHelper::kses( FrmFieldsHelper::get_user_display_name( $entry->user_id, 'display_name', array( 'link' => true ) ), array( 'a' ) )
50
+ ); // WPCS: XSS ok.
51
+ ?>
52
  </div>
53
  <?php } ?>
54
 
55
  <?php if ( $entry->updated_by && $entry->updated_by != $entry->user_id ) { ?>
56
  <div class="misc-pub-section">
57
  <span class="dashicons dashicons-admin-users wp-media-buttons-icon"></span>
58
+ <?php
59
+ printf(
60
+ esc_html__( 'Updated by: %1$s', 'formidable' ),
61
+ FrmAppHelper::kses( FrmFieldsHelper::get_user_display_name( $entry->updated_by, 'display_name', array( 'link' => true ) ), array( 'a' ) )
62
+ ); // WPCS: XSS ok.
63
+ ?>
64
  </div>
65
  <?php } ?>
66
  <?php } ?>
classes/views/frm-fields/single-option.php CHANGED
@@ -4,7 +4,9 @@
4
  <input type="<?php echo esc_attr( $field['type'] ); ?>" name="<?php echo esc_attr( $field_name . ( 'checkbox' === $field['type'] ? '[]' : '' ) ); ?>" value="<?php echo esc_attr( $field_val ) ?>"<?php echo esc_html( isset( $checked ) ? $checked : '' ); ?>/>
5
  <?php } ?>
6
 
7
- <label class="frm_ipe_field_option field_<?php echo esc_attr( $field['id'] ) ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>"><?php echo esc_html( '' === $opt ? __( '(Blank)', 'formidable' ) : $opt ); ?></label>
 
 
8
  <input type="hidden" name="field_options[options_<?php echo esc_attr( $field['id'] ) ?>][<?php echo esc_attr( $opt_key ) ?>][label]" value="<?php echo esc_attr( $opt ) ?>" />
9
 
10
  <span class="frm_option_key field_<?php echo esc_attr( $field['id'] ) ?>_option_key<?php echo esc_attr( $field['separate_value'] ? '' : ' frm_hidden' ); ?>">
4
  <input type="<?php echo esc_attr( $field['type'] ); ?>" name="<?php echo esc_attr( $field_name . ( 'checkbox' === $field['type'] ? '[]' : '' ) ); ?>" value="<?php echo esc_attr( $field_val ) ?>"<?php echo esc_html( isset( $checked ) ? $checked : '' ); ?>/>
5
  <?php } ?>
6
 
7
+ <label class="frm_ipe_field_option field_<?php echo esc_attr( $field['id'] ) ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>"><?php
8
+ echo '' === $opt ? esc_html__( '(Blank)', 'formidable' ) : FrmAppHelper::kses( $opt, 'all' ); // WPCS: XSS ok.
9
+ ?></label>
10
  <input type="hidden" name="field_options[options_<?php echo esc_attr( $field['id'] ) ?>][<?php echo esc_attr( $opt_key ) ?>][label]" value="<?php echo esc_attr( $opt ) ?>" />
11
 
12
  <span class="frm_option_key field_<?php echo esc_attr( $field['id'] ) ?>_option_key<?php echo esc_attr( $field['separate_value'] ? '' : ' frm_hidden' ); ?>">
classes/views/frm-forms/add_field.php CHANGED
@@ -14,7 +14,7 @@
14
  </span>
15
  <?php } ?>
16
  <label class="<?php echo esc_attr( $field['type'] === 'end_divider' ? '' : 'frm_ipe_field_label' ); ?> frm_primary_label <?php echo esc_attr( $field['type'] === 'break' ? 'button' : '' ); ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php
17
- echo ( $field['name'] === '' ) ? esc_html__( '(no label)', 'formidable' ) : FrmAppHelper::kses( force_balance_tags( $field['name'], 'all' ) ); // WPCS: XSS ok.
18
  ?></label>
19
  <input type="hidden" name="field_options[name_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['name'] ); ?>" />
20
 
@@ -71,7 +71,7 @@ if ( in_array( $field['type'], array( 'select', 'radio', 'checkbox' ) ) ) {
71
  } elseif ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) {
72
  ?>
73
  <div id="frm_add_field_<?php echo esc_attr( $field['id'] ); ?>">
74
- <a href="javascript:void(0);" data-opttype="single" class="button frm_cb_button frm_add_opt"><?php esc_html_e( 'Add Option', 'formidable' ) ?></a>
75
 
76
  <?php if ( FrmAppHelper::pro_is_installed() ) { ?>
77
  <a href="javascript:void(0);" id="other_button_<?php echo esc_attr( $field['id'] ); ?>" data-opttype="other" data-ftype="<?php echo esc_attr( $field['type'] ) ?>" class="button frm_cb_button frm_add_opt<?php echo ( in_array( $field['type'], array( 'radio', 'select' ) ) && $field['other'] == true ? ' frm_hidden' : '' ); ?>"><?php esc_html_e( 'Add "Other"', 'formidable' ) ?></a>
@@ -186,7 +186,7 @@ if ( $display['options'] ) {
186
  </tr>
187
  <?php } ?>
188
 
189
- <?php if ( $display['label_position'] ) { ?>
190
  <tr>
191
  <td class="frm_150_width"><label><?php esc_html_e( 'Label Position', 'formidable' ) ?></label></td>
192
  <td>
14
  </span>
15
  <?php } ?>
16
  <label class="<?php echo esc_attr( $field['type'] === 'end_divider' ? '' : 'frm_ipe_field_label' ); ?> frm_primary_label <?php echo esc_attr( $field['type'] === 'break' ? 'button' : '' ); ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php
17
+ echo ( $field['name'] === '' ) ? esc_html__( '(no label)', 'formidable' ) : FrmAppHelper::kses( force_balance_tags( $field['name'] ), 'all' ); // WPCS: XSS ok.
18
  ?></label>
19
  <input type="hidden" name="field_options[name_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['name'] ); ?>" />
20
 
71
  } elseif ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) {
72
  ?>
73
  <div id="frm_add_field_<?php echo esc_attr( $field['id'] ); ?>">
74
+ <a href="javascript:void(0);" data-opttype="single" class="button frm_cb_button frm_add_opt" data-clicks="0"><?php esc_html_e( 'Add Option', 'formidable' ) ?></a>
75
 
76
  <?php if ( FrmAppHelper::pro_is_installed() ) { ?>
77
  <a href="javascript:void(0);" id="other_button_<?php echo esc_attr( $field['id'] ); ?>" data-opttype="other" data-ftype="<?php echo esc_attr( $field['type'] ) ?>" class="button frm_cb_button frm_add_opt<?php echo ( in_array( $field['type'], array( 'radio', 'select' ) ) && $field['other'] == true ? ' frm_hidden' : '' ); ?>"><?php esc_html_e( 'Add "Other"', 'formidable' ) ?></a>
186
  </tr>
187
  <?php } ?>
188
 
189
+ <?php if ( $display['label_position'] ) { ?>
190
  <tr>
191
  <td class="frm_150_width"><label><?php esc_html_e( 'Label Position', 'formidable' ) ?></label></td>
192
  <td>
css/frm_admin.css CHANGED
@@ -1797,11 +1797,14 @@ label.frm_action_events{
1797
  }
1798
 
1799
  .frm_form_action_settings .frm_logic_row,
1800
- .frm_form_action_settings .frm_posttax_row{
 
1801
  margin:14px 0;
1802
  }
1803
  .frm_form_action_settings .frm_logic_row select,
1804
- .frm_form_action_settings .frm_logic_row input{
 
 
1805
  max-width:30%;
1806
  }
1807
  .frm_form_settings input[type="text"]{
1797
  }
1798
 
1799
  .frm_form_action_settings .frm_logic_row,
1800
+ .frm_form_action_settings .frm_posttax_row,
1801
+ .advanced_settings .frm_logic_row {
1802
  margin:14px 0;
1803
  }
1804
  .frm_form_action_settings .frm_logic_row select,
1805
+ .frm_form_action_settings .frm_logic_row input,
1806
+ .advanced_settings .frm_logic_row select,
1807
+ .advanced_settings .frm_logic_row input{
1808
  max-width:30%;
1809
  }
1810
  .frm_form_settings input[type="text"]{
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 3.01.03
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 3.02
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -138,6 +138,8 @@ function frmFrontFormJS(){
138
  errors = checkNumberField( field, errors );
139
  } else if ( field.type === 'email' ) {
140
  errors = checkEmailField( field, errors, emailFields );
 
 
141
  } else if ( field.pattern !== null ) {
142
  errors = checkPatternField( field, errors );
143
  }
@@ -170,6 +172,8 @@ function frmFrontFormJS(){
170
  errors = checkEmailField( field, errors, emailFields );
171
  } else if ( field.type === 'number' ) {
172
  errors = checkNumberField( field, errors );
 
 
173
  } else if ( field.pattern !== null ) {
174
  errors = checkPatternField( field, errors );
175
  }
@@ -316,6 +320,25 @@ function frmFrontFormJS(){
316
  return errors;
317
  }
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  function hasInvisibleRecaptcha( object ) {
320
  if ( typeof frmProForm !== 'undefined' && frmProForm.goingToPreviousPage( object ) ) {
321
  return false;
138
  errors = checkNumberField( field, errors );
139
  } else if ( field.type === 'email' ) {
140
  errors = checkEmailField( field, errors, emailFields );
141
+ } else if (field.type === 'password') {
142
+ errors = checkPasswordField(field, errors);
143
  } else if ( field.pattern !== null ) {
144
  errors = checkPatternField( field, errors );
145
  }
172
  errors = checkEmailField( field, errors, emailFields );
173
  } else if ( field.type === 'number' ) {
174
  errors = checkNumberField( field, errors );
175
+ } else if (field.type === 'password') {
176
+ errors = checkPasswordField( field, errors );
177
  } else if ( field.pattern !== null ) {
178
  errors = checkPatternField( field, errors );
179
  }
320
  return errors;
321
  }
322
 
323
+ function checkPasswordField( field, errors ) {
324
+ var classes = field.className;
325
+
326
+ if (!classes.includes("frm_strong_pass")) {
327
+ return errors;
328
+ }
329
+
330
+ var text = field.value;
331
+ var regEx = /^(?=.*?[a-z])(?=.*?[A-Z])(?=.*[^a-zA-Z0-9])(?=.*?[0-9]).{8,}$/;
332
+ var matches = regEx.test(text); //true if matches format, false otherwise
333
+
334
+ if (!matches) {
335
+ var fieldID = getFieldId( field, true );
336
+ errors[ fieldID ] = getFieldValidationMessage( field, 'data-invmsg' );
337
+ }
338
+
339
+ return errors;
340
+ }
341
+
342
  function hasInvisibleRecaptcha( object ) {
343
  if ( typeof frmProForm !== 'undefined' && frmProForm.goingToPreviousPage( object ) ) {
344
  return false;
js/formidable.min.js CHANGED
@@ -1,35 +1,35 @@
1
- function frmFrontFormJS(){function e(){var a=jQuery(this),b=a.closest(".frm_inside_container").find("label.frm_primary_label");0<a.val().length?b.addClass("frm_visible"):b.removeClass("frm_visible")}function f(a,b){var c="";c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;c=c.filter(function(a){return""!==a});var d=c[0],g=!1;if(1===
2
- c.length)return d;if("[form"===c[1]||"[row_ids"===c[1])return 0;jQuery('input[name="item_meta['+d+'][form]"]').length&&(d=c[2].replace("[",""),g=!0);"other"===d&&(d=g?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function h(a,b){var c=a.getAttribute("data-frmfile");if("hidden"===a.type&&null===c)return b;var d="",g="";if("checkbox"===a.type||"radio"===a.type)c=jQuery('input[name="'+a.name+'"]').closest(".frm_required_field").find("input:checked"),
3
- jQuery(c).each(function(){d=this.value});else if("file"===a.type||c)"undefined"===typeof c&&(c=f(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=p(c)),g=c;else{c=a.className;if(-1!==c.indexOf("frm_pos_none"))return b;d=jQuery(a).val();if(null===d)d="";else if("string"!==typeof d){g=d;d="";for(var k=0;k<g.length;k++)""!==g[k]&&(d=g[k])}g=-1===c.indexOf("frm_other_input")?f(a,!0):f(a,!1);-1!==c.indexOf("frm_time_select")&&(g=g.replace("-H","").replace("-m",""))}""===d&&(""===g&&(g=f(a,!0)),
4
- g in b||(b[g]=r(a,"data-reqmsg")));return b}function p(a){var b="";jQuery('input[name="file'+a+'"], input[name="file'+a+'[]"], input[name^="item_meta['+a+']"]').each(function(){""===b&&(b=this.value)});return b}function q(a,b,c){var d=a.value,g=f(a,!0);if(g in b)return b;var k=0===g.indexOf("conf_");if(""!==d||k){var n=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i,e=r(a,"data-invmsg");""!==
5
- d&&!1===n.test(d)?(b[g]=e,k&&(b[g.replace("conf_","")]="")):k&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[g]="",b[g.replace("conf_","")]=""))}return b}function w(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=f(a,!0),c in b||(b[c]=r(a,"data-invmsg")));return b}function x(a,b){var c=a.value,d=r(a,"pattern");if(""!==d&&""!==c){var g=f(a,!0);g in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[g]=r(a,"data-invmsg")))}return b}function r(a,b){var c=a.getAttribute(b);null===
6
- c&&(c="");return c}function D(a,b){"undefined"===typeof b&&jQuery(a).find('input[name="frm_action"]').val();var c=jQuery(a).find(".frm_form_field");c.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var d={content:"",errors:{},pass:!1};null===b&&(b=d);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):d;if("undefined"!==typeof b.redirect)jQuery(document).trigger("frmBeforeFormRedirect",
7
- [a,b]),window.location=b.redirect;else if(""!==b.content){u(jQuery(a));-1!=frm_js.offset&&frmFrontForm.scrollMsg(jQuery(a),!1);var k=jQuery(a).find('input[name="form_id"]').val();b.content=b.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");d=jQuery(a).closest(".frm_forms");var e=jQuery(".frm_end_ajax_"+k);e.length&&(d.nextUntil(".frm_end_ajax_"+k).remove(),e.remove());d.replaceWith(b.content);d=b;if(history.pushState&&"undefined"!==typeof d.page){var f=d.page;e=encodeURI("frm_page");
8
- f=encodeURI(f);for(var l=document.location.search.substr(1).split("&"),h=l.length,m;h--;)if(m=l[h].split("="),m[0]==e){m[1]=f;l[h]=m.join("=");break}0>h&&(l[l.length]=[e,f].join("="));e=l.join("&");window.history.pushState({html:d.html},"","?"+e)}"function"===typeof frmThemeOverride_frmAfterSubmit&&(k=jQuery('input[name="frm_page_order_'+k+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,k,b.content,a));jQuery(b.content).find(".frm_message").length?
9
- jQuery(document).trigger("frmFormComplete",[a,b]):jQuery(document).trigger("frmPageChanged",[a,b])}else if(Object.keys(b.errors).length){u(jQuery(a),"enable");d=!0;y();e=!1;for(k in b.errors)f=jQuery(a).find("#frm_field_"+k+"_container"),f.length&&(f.is(":visible")||(l=f.closest(".frm_toggle_container"),l.length&&(l=l.prev(),l.hasClass("frm_trigger")||(l=l.prev(".frm_trigger")),l.click())),f.is(":visible")&&(v(f,k,b.errors),d=!1,f=jQuery(a).find("#frm_field_"+k+"_container .frm-g-recaptcha, #frm_field_"+
10
- k+"_container .g-recaptcha"),f.length&&(e=!0,f=f.data("rid"),jQuery().grecaptcha&&(f?grecaptcha.reset(f):grecaptcha.reset()))));jQuery(document).trigger("frmFormErrors",[a,b]);c.removeClass("frm_doing_ajax");z(a);!0!==e&&A(a,!1);d?a.submit():jQuery(a).prepend(b.error_message)}else E(a),A(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function v(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"===
11
- typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"),jQuery(document).trigger("frmAddFieldError",[a,b,c]))}function y(){jQuery(".form-field").removeClass("frm_blank_field has-error");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function z(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function B(a){a.hasClass("frm_loading_form")||(a.addClass("frm_loading_form"),
12
- a.trigger("frmStartFormLoading"));a.find('input[type="submit"], input[type="button"], button[type="submit"]').attr("disabled","disabled")}function u(a,b,c){0<c||(a.removeClass("frm_loading_form"),a.trigger("frmEndFormLoading"),"enable"===b&&a.find('input[type="submit"], input[type="button"], button[type="submit"]').removeAttr("disabled"))}function E(a){var b=document.getElementById("frm_loading");null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!==typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},
13
- 2E3))}function A(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}function F(){C(jQuery(this),"clear")}function G(){C(jQuery(this),"replace")}function C(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"===typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,
14
- "\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function H(){var a=jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});return!1}function I(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function J(){var a=jQuery(this).data("frmtoggle");
15
- jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function K(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0;d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function L(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function M(){Array.prototype.filter||(Array.prototype.filter=function(a,
16
- b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var f=[],e=0;e<d;e++)if(e in c){var h=c[e];a.call(b,h,e,c)&&f.push(h)}return f})}function N(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var t="",m=[];return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);
17
- jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",F);jQuery(document).on("blur",".frm_toggle_default",G);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(H);jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',frmFrontForm.fieldValueChanged);
18
- jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",e);jQuery(document).on("click","a[data-frmconfirm]",I);jQuery("a[data-frmtoggle]").click(J);K();L();M();N()},getFieldId:function(a,b){return f(a,b)},renderRecaptcha:function(a){var b=a.getAttribute("data-size"),c={sitekey:a.getAttribute("data-sitekey"),size:b,theme:a.getAttribute("data-theme")};if("invisible"===b){var d=jQuery(a).closest("form").find('input[name="form_id"]').val();
19
- c.callback=function(a){frmFrontForm.afterRecaptcha(a,d)}}b=grecaptcha.render(a.id,c);a.setAttribute("data-rid",b)},afterSingleRecaptcha:function(a){a=jQuery(".frm-show-form .g-recaptcha").closest("form")[0];frmFrontForm.submitFormNow(a)},afterRecaptcha:function(a,b){var c=jQuery("#frm_form_"+b+"_container form")[0];frmFrontForm.submitFormNow(c)},submitForm:function(a){frmFrontForm.submitFormManual(a,this)},submitFormManual:function(a,b){if("undefined"!==typeof frmProForm&&frmProForm.goingToPreviousPage(b))var c=
20
- !1;else{var d=jQuery(b).find('.frm-g-recaptcha[data-size="invisible"], .g-recaptcha[data-size="invisible"]');d.length?(c=d.data("rid"),c=0===grecaptcha.getResponse(c).length?d:!1):c=!1}d=b.className.trim().split(/\s+/gi);d&&1>c.length&&!(-1<d.indexOf("frm_pro_form"))||jQuery("body").hasClass("wp-admin")||(a.preventDefault(),c.length?(d=c.data("rid"),grecaptcha.reset(d),grecaptcha.execute(d)):(c=frmFrontForm.validateFormSubmit(b),0===Object.keys(c).length&&(B(jQuery(b)),frmFrontForm.submitFormNow(b,
21
- d))))},submitFormNow:function(a){-1<a.className.trim().split(/\s+/gi).indexOf("frm_ajax_submit")?1>jQuery(a).find('input[type="file"]').filter(function(){return!!this.value}).length?(t=jQuery(a).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(a,t)):a.submit():a.submit()},validateFormSubmit:function(a){"undefined"!==typeof tinyMCE&&jQuery(a).find(".wp-editor-wrap").length&&tinyMCE.triggerSave();m=[];var b=jQuery(a).hasClass("frm_js_validate");b&&"undefined"!==typeof frmProForm&&
22
- (frmProForm.savingDraft(a)||frmProForm.goingToPreviousPage(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(m).length&&frmFrontForm.addAjaxFormErrors(a));return m},getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=h(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");d=jQuery(a).find("input,select,textarea");
23
- if(d.length){e=0;for(var f=d.length;e<f;e++){var n=d[e];""!==n.value&&"hidden"!==n.type&&("number"===n.type?b=w(n,b):"email"===n.type?b=q(n,b,c):null!==n.pattern&&(b=x(n,b)))}}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));m=b;if("function"===typeof frmThemeOverride_jsErrors&&(t=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(t,
24
- a),Object.keys(a).length))for(var p in a)m[p]=a[p];return m},addAjaxFormErrors:function(a){y();for(var b in m){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?v(c,b,m):delete m[b]}z(a)},checkFormErrors:function(a,b){D(a,b)},checkRequiredField:function(a,b){return h(a,b)},showSubmitLoading:function(a){B(a)},removeSubmitLoading:function(a,b,c){u(a,b,c)},scrollToID:function(a){a=jQuery(document.getElementById(a));frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if("undefined"===typeof b){if(a=
25
- jQuery(document.getElementById("frm_form_"+a+"_container")),1>a.length)return}else a="string"===typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a;if(a=a.offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},
26
- 500),!1}},fieldValueChanged:function(a){var b=frmFrontForm.getFieldId(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||a.frmTriggered!=b)&&(jQuery(document).trigger("frmFieldChanged",[this,b,a]),!0!==a.selfTriggered&&jQuery(this).closest("form").hasClass("frm_js_validate"))){a=[];b=jQuery(this).closest(".frm_form_field");b.hasClass("frm_required_field")&&!jQuery(this).hasClass("frm_optional")&&(a=h(this,a));if(1>a.length)if("email"===this.type){var c=jQuery(this).closest("form").find("input[type=email]");
27
- a=q(this,a,c)}else"number"===this.type?a=w(this,a):null!==this.pattern&&(a=x(this,a));b.removeClass("frm_blank_field has-error");b.find(".frm_error").remove();if(0<Object.keys(a).length)for(var d in a)v(b,d,a)}},savingDraft:function(a){console.warn("DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft");if("undefined"!==typeof frmProForm)return frmProForm.savingDraft(a)},goingToPreviousPage:function(a){console.warn("DEPRECATED: function frmFrontForm.goingToPreviousPage in v3.0 use frmProForm.goingToPreviousPage");
28
- if("undefined"!==typeof frmProForm)return frmProForm.goingToPreviousPage(a)},hideOrShowFields:function(a,b){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");"undefined"!==typeof frmProForm&&frmProForm.hideOrShowFields()},hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");"undefined"!==typeof frmProForm&&frmProForm.hidePreviouslyHiddenFields()},
29
- checkDependentDynamicFields:function(a){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");"undefined"!==typeof frmProForm&&frmProForm.checkDependentDynamicFields(a)},checkDependentLookupFields:function(a){console.warn("DEPRECATED: function frmFrontForm.checkDependentLookupFields in v3.0 use frmProForm.checkDependentLookupFields");"undefined"!==typeof frmProForm&&frmProForm.checkDependentLookupFields(a)},loadGoogle:function(){console.warn("DEPRECATED: function frmFrontForm.loadGoogle in v3.0 use frmProForm.loadGoogle");
30
- frmProForm.loadGoogle()},removeUsedTimes:function(a,b){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes in v3.0 use frmProForm.removeUsedTimes");"undefined"!==typeof frmProForm&&frmProForm.removeUsedTimes()},escapeHtml:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}
31
- var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(e){frmFrontForm.init()});function frmRecaptcha(){for(var e=jQuery(".frm-g-recaptcha"),f=0,h=e.length;f<h;f++)frmFrontForm.renderRecaptcha(e[f])}function frmAfterRecaptcha(e){frmFrontForm.afterSingleRecaptcha(e)}
32
- function frmUpdateField(e,f,h,p,q){jQuery(document.getElementById("frm_update_field_"+e+"_"+f+"_"+q)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:e,field_id:f,value:h,nonce:frm_js.nonce},success:function(){""===p.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+e+"_"+f+"_"+q)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+e+"_"+f+"_"+q)).replaceWith(p)}})}
33
- function frmDeleteEntry(e,f){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+e)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+e+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:e,nonce:frm_js.nonce},success:function(h){"success"===h.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(f+e)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+
34
- e)).replaceWith(h)}})}function frmOnSubmit(e){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(e,this)}
35
- function frm_resend_email(e,f){console.warn("DEPRECATED: function frm_resend_email in v2.0");var h=jQuery(document.getElementById("frm_resend_email"));h.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:e,form_id:f,nonce:frm_js.nonce},success:function(e){h.replaceWith(e)}})};
1
+ function frmFrontFormJS(){function e(){var a=jQuery(this),b=a.closest(".frm_inside_container").find("label.frm_primary_label");0<a.val().length?b.addClass("frm_visible"):b.removeClass("frm_visible")}function f(a,b){var c="";c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;c=c.filter(function(a){return""!==a});var d=c[0],h=!1;if(1===
2
+ c.length)return d;if("[form"===c[1]||"[row_ids"===c[1])return 0;jQuery('input[name="item_meta['+d+'][form]"]').length&&(d=c[2].replace("[",""),h=!0);"other"===d&&(d=h?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function l(a,b){var c=a.getAttribute("data-frmfile");if("hidden"===a.type&&null===c)return b;var d="",h="";if("checkbox"===a.type||"radio"===a.type)c=jQuery('input[name="'+a.name+'"]').closest(".frm_required_field").find("input:checked"),
3
+ jQuery(c).each(function(){d=this.value});else if("file"===a.type||c)"undefined"===typeof c&&(c=f(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=n(c)),h=c;else{c=a.className;if(-1!==c.indexOf("frm_pos_none"))return b;d=jQuery(a).val();if(null===d)d="";else if("string"!==typeof d){h=d;d="";for(var k=0;k<h.length;k++)""!==h[k]&&(d=h[k])}h=-1===c.indexOf("frm_other_input")?f(a,!0):f(a,!1);-1!==c.indexOf("frm_time_select")&&(h=h.replace("-H","").replace("-m",""))}""===d&&(""===h&&(h=f(a,!0)),
4
+ h in b||(b[h]=p(a,"data-reqmsg")));return b}function n(a){var b="";jQuery('input[name="file'+a+'"], input[name="file'+a+'[]"], input[name^="item_meta['+a+']"]').each(function(){""===b&&(b=this.value)});return b}function q(a,b,c){var d=a.value,h=f(a,!0);if(h in b)return b;var k=0===h.indexOf("conf_");if(""!==d||k){var g=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i,e=p(a,"data-invmsg");""!==
5
+ d&&!1===g.test(d)?(b[h]=e,k&&(b[h.replace("conf_","")]="")):k&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[h]="",b[h.replace("conf_","")]=""))}return b}function v(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=f(a,!0),c in b||(b[c]=p(a,"data-invmsg")));return b}function w(a,b){var c=a.value,d=p(a,"pattern");if(""!==d&&""!==c){var h=f(a,!0);h in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[h]=p(a,"data-invmsg")))}return b}function x(a,b){if(!a.className.includes("frm_strong_pass"))return b;
6
+ if(!/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*[^a-zA-Z0-9])(?=.*?[0-9]).{8,}$/.test(a.value)){var c=f(a,!0);b[c]=p(a,"data-invmsg")}return b}function p(a,b){var c=a.getAttribute(b);null===c&&(c="");return c}function D(a,b){"undefined"===typeof b&&jQuery(a).find('input[name="frm_action"]').val();var c=jQuery(a).find(".frm_form_field");c.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var d={content:"",
7
+ errors:{},pass:!1};null===b&&(b=d);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):d;if("undefined"!==typeof b.redirect)jQuery(document).trigger("frmBeforeFormRedirect",[a,b]),window.location=b.redirect;else if(""!==b.content){t(jQuery(a));-1!=frm_js.offset&&frmFrontForm.scrollMsg(jQuery(a),!1);var k=jQuery(a).find('input[name="form_id"]').val();b.content=b.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");d=jQuery(a).closest(".frm_forms");var g=jQuery(".frm_end_ajax_"+
8
+ k);g.length&&(d.nextUntil(".frm_end_ajax_"+k).remove(),g.remove());d.replaceWith(b.content);d=b;if(history.pushState&&"undefined"!==typeof d.page){var e=d.page;g=encodeURI("frm_page");e=encodeURI(e);for(var f=document.location.search.substr(1).split("&"),l=f.length,m;l--;)if(m=f[l].split("="),m[0]==g){m[1]=e;f[l]=m.join("=");break}0>l&&(f[f.length]=[g,e].join("="));g=f.join("&");window.history.pushState({html:d.html},"","?"+g)}"function"===typeof frmThemeOverride_frmAfterSubmit&&(k=jQuery('input[name="frm_page_order_'+
9
+ k+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,k,b.content,a));jQuery(b.content).find(".frm_message").length?jQuery(document).trigger("frmFormComplete",[a,b]):jQuery(document).trigger("frmPageChanged",[a,b])}else if(Object.keys(b.errors).length){t(jQuery(a),"enable");d=!0;y();g=!1;for(k in b.errors)e=jQuery(a).find("#frm_field_"+k+"_container"),e.length&&(e.is(":visible")||(f=e.closest(".frm_toggle_container"),f.length&&(f=f.prev(),f.hasClass("frm_trigger")||
10
+ (f=f.prev(".frm_trigger")),f.click())),e.is(":visible")&&(u(e,k,b.errors),d=!1,e=jQuery(a).find("#frm_field_"+k+"_container .frm-g-recaptcha, #frm_field_"+k+"_container .g-recaptcha"),e.length&&(g=!0,e=e.data("rid"),jQuery().grecaptcha&&(e?grecaptcha.reset(e):grecaptcha.reset()))));jQuery(document).trigger("frmFormErrors",[a,b]);c.removeClass("frm_doing_ajax");z(a);!0!==g&&A(a,!1);d?a.submit():jQuery(a).prepend(b.error_message)}else E(a),A(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");
11
+ a.submit()}})}function u(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"===typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"),jQuery(document).trigger("frmAddFieldError",[a,b,c]))}function y(){jQuery(".form-field").removeClass("frm_blank_field has-error");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function z(a){var b=jQuery(a).find(".frm_blank_field:first");
12
+ b.length&&frmFrontForm.scrollMsg(b,a,!0)}function B(a){a.hasClass("frm_loading_form")||(a.addClass("frm_loading_form"),a.trigger("frmStartFormLoading"));a.find('input[type="submit"], input[type="button"], button[type="submit"]').attr("disabled","disabled")}function t(a,b,c){0<c||(a.removeClass("frm_loading_form"),a.trigger("frmEndFormLoading"),"enable"===b&&a.find('input[type="submit"], input[type="button"], button[type="submit"]').removeAttr("disabled"))}function E(a){var b=document.getElementById("frm_loading");
13
+ null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!==typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},2E3))}function A(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}function F(){C(jQuery(this),"clear")}function G(){C(jQuery(this),"replace")}
14
+ function C(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"===typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function H(){var a=jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});
15
+ return!1}function I(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function J(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function K(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0;d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function L(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=
16
+ function(){return this.replace(/^\s+|\s+$/g,"")})}function M(){Array.prototype.filter||(Array.prototype.filter=function(a,b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var e=[],f=0;f<d;f++)if(f in c){var g=c[f];a.call(b,g,f,c)&&e.push(g)}return e})}function N(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var r="",m=[];return{init:function(){jQuery(document).off("submit.formidable",
17
+ ".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",F);jQuery(document).on("blur",".frm_toggle_default",G);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(H);jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',
18
+ frmFrontForm.fieldValueChanged);jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",e);jQuery(document).on("click","a[data-frmconfirm]",I);jQuery("a[data-frmtoggle]").click(J);K();L();M();N()},getFieldId:function(a,b){return f(a,b)},renderRecaptcha:function(a){var b=a.getAttribute("data-size"),c={sitekey:a.getAttribute("data-sitekey"),size:b,theme:a.getAttribute("data-theme")};if("invisible"===
19
+ b){var d=jQuery(a).closest("form").find('input[name="form_id"]').val();c.callback=function(a){frmFrontForm.afterRecaptcha(a,d)}}b=grecaptcha.render(a.id,c);a.setAttribute("data-rid",b)},afterSingleRecaptcha:function(a){a=jQuery(".frm-show-form .g-recaptcha").closest("form")[0];frmFrontForm.submitFormNow(a)},afterRecaptcha:function(a,b){var c=jQuery("#frm_form_"+b+"_container form")[0];frmFrontForm.submitFormNow(c)},submitForm:function(a){frmFrontForm.submitFormManual(a,this)},submitFormManual:function(a,
20
+ b){if("undefined"!==typeof frmProForm&&frmProForm.goingToPreviousPage(b))var c=!1;else{var d=jQuery(b).find('.frm-g-recaptcha[data-size="invisible"], .g-recaptcha[data-size="invisible"]');d.length?(c=d.data("rid"),c=0===grecaptcha.getResponse(c).length?d:!1):c=!1}d=b.className.trim().split(/\s+/gi);d&&1>c.length&&!(-1<d.indexOf("frm_pro_form"))||jQuery("body").hasClass("wp-admin")||(a.preventDefault(),c.length?(d=c.data("rid"),grecaptcha.reset(d),grecaptcha.execute(d)):(c=frmFrontForm.validateFormSubmit(b),
21
+ 0===Object.keys(c).length&&(B(jQuery(b)),frmFrontForm.submitFormNow(b,d))))},submitFormNow:function(a){-1<a.className.trim().split(/\s+/gi).indexOf("frm_ajax_submit")?1>jQuery(a).find('input[type="file"]').filter(function(){return!!this.value}).length?(r=jQuery(a).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(a,r)):a.submit():a.submit()},validateFormSubmit:function(a){"undefined"!==typeof tinyMCE&&jQuery(a).find(".wp-editor-wrap").length&&tinyMCE.triggerSave();m=[];var b=jQuery(a).hasClass("frm_js_validate");
22
+ b&&"undefined"!==typeof frmProForm&&(frmProForm.savingDraft(a)||frmProForm.goingToPreviousPage(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(m).length&&frmFrontForm.addAjaxFormErrors(a));return m},getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=l(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");
23
+ d=jQuery(a).find("input,select,textarea");if(d.length){e=0;for(var f=d.length;e<f;e++){var g=d[e];""!==g.value&&"hidden"!==g.type&&("number"===g.type?b=v(g,b):"email"===g.type?b=q(g,b,c):"password"===g.type?b=x(g,b):null!==g.pattern&&(b=w(g,b)))}}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));m=b;if("function"===typeof frmThemeOverride_jsErrors&&
24
+ (r=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(r,a),Object.keys(a).length))for(var n in a)m[n]=a[n];return m},addAjaxFormErrors:function(a){y();for(var b in m){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?u(c,b,m):delete m[b]}z(a)},checkFormErrors:function(a,b){D(a,b)},checkRequiredField:function(a,b){return l(a,b)},showSubmitLoading:function(a){B(a)},removeSubmitLoading:function(a,b,c){t(a,b,c)},scrollToID:function(a){a=jQuery(document.getElementById(a));
25
+ frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if("undefined"===typeof b){if(a=jQuery(document.getElementById("frm_form_"+a+"_container")),1>a.length)return}else a="string"===typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a;if(a=a.offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||
26
+ a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},500),!1}},fieldValueChanged:function(a){var b=frmFrontForm.getFieldId(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||a.frmTriggered!=b)&&(jQuery(document).trigger("frmFieldChanged",[this,b,a]),!0!==a.selfTriggered&&jQuery(this).closest("form").hasClass("frm_js_validate"))){a=[];b=jQuery(this).closest(".frm_form_field");b.hasClass("frm_required_field")&&!jQuery(this).hasClass("frm_optional")&&
27
+ (a=l(this,a));if(1>a.length)if("email"===this.type){var c=jQuery(this).closest("form").find("input[type=email]");a=q(this,a,c)}else"number"===this.type?a=v(this,a):"password"===this.type?a=x(this,a):null!==this.pattern&&(a=w(this,a));b.removeClass("frm_blank_field has-error");b.find(".frm_error").remove();if(0<Object.keys(a).length)for(var d in a)u(b,d,a)}},savingDraft:function(a){console.warn("DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft");if("undefined"!==typeof frmProForm)return frmProForm.savingDraft(a)},
28
+ goingToPreviousPage:function(a){console.warn("DEPRECATED: function frmFrontForm.goingToPreviousPage in v3.0 use frmProForm.goingToPreviousPage");if("undefined"!==typeof frmProForm)return frmProForm.goingToPreviousPage(a)},hideOrShowFields:function(a,b){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");"undefined"!==typeof frmProForm&&frmProForm.hideOrShowFields()},hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");
29
+ "undefined"!==typeof frmProForm&&frmProForm.hidePreviouslyHiddenFields()},checkDependentDynamicFields:function(a){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");"undefined"!==typeof frmProForm&&frmProForm.checkDependentDynamicFields(a)},checkDependentLookupFields:function(a){console.warn("DEPRECATED: function frmFrontForm.checkDependentLookupFields in v3.0 use frmProForm.checkDependentLookupFields");"undefined"!==typeof frmProForm&&
30
+ frmProForm.checkDependentLookupFields(a)},loadGoogle:function(){console.warn("DEPRECATED: function frmFrontForm.loadGoogle in v3.0 use frmProForm.loadGoogle");frmProForm.loadGoogle()},removeUsedTimes:function(a,b){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes in v3.0 use frmProForm.removeUsedTimes");"undefined"!==typeof frmProForm&&frmProForm.removeUsedTimes()},escapeHtml:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,
31
+ "&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(e){frmFrontForm.init()});function frmRecaptcha(){for(var e=jQuery(".frm-g-recaptcha"),f=0,l=e.length;f<l;f++)frmFrontForm.renderRecaptcha(e[f])}function frmAfterRecaptcha(e){frmFrontForm.afterSingleRecaptcha(e)}
32
+ function frmUpdateField(e,f,l,n,q){jQuery(document.getElementById("frm_update_field_"+e+"_"+f+"_"+q)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:e,field_id:f,value:l,nonce:frm_js.nonce},success:function(){""===n.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+e+"_"+f+"_"+q)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+e+"_"+f+"_"+q)).replaceWith(n)}})}
33
+ function frmDeleteEntry(e,f){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+e)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+e+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:e,nonce:frm_js.nonce},success:function(l){"success"===l.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(f+e)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+
34
+ e)).replaceWith(l)}})}function frmOnSubmit(e){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(e,this)}
35
+ function frm_resend_email(e,f){console.warn("DEPRECATED: function frm_resend_email in v2.0");var l=jQuery(document.getElementById("frm_resend_email"));l.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:e,form_id:f,nonce:frm_js.nonce},success:function(e){l.replaceWith(e)}})};
js/formidable_admin.js CHANGED
@@ -890,13 +890,18 @@ function frmAdminBuildJS(){
890
  //Add new option or "Other" option to radio/checkbox/dropdown
891
  function addFieldOption(){
892
  /*jshint validthis:true */
 
 
 
 
 
893
  var field_id = jQuery(this).closest('li').data('fid');
894
  var opt_type = jQuery(this).data('opttype');
895
  var opt_key = 1;
896
  var lastOpt = jQuery('#frm_field_'+ field_id +'_opts li:last');
897
  if(lastOpt.length){
898
  opt_key = lastOpt.attr('id').replace('frm_delete_field_'+ field_id +'-', '').replace('_container', '').replace('other_', '');
899
- opt_key = parseInt(opt_key) + 1;
900
  }
901
 
902
  //Update hidden field
@@ -1922,7 +1927,7 @@ function frmAdminBuildJS(){
1922
  var meta_name = 0;
1923
  var form_id = document.getElementById('form_id').value;
1924
  if(jQuery('#frm_form_action_'+id+' .frm_logic_row').length){
1925
- meta_name = 1 + parseInt(jQuery('#frm_form_action_'+id+' .frm_logic_row:last').attr('id').replace('frm_logic_'+id+'_', ''));
1926
  }
1927
  jQuery.ajax({
1928
  type:'POST',url:ajaxurl,
@@ -1938,6 +1943,55 @@ function frmAdminBuildJS(){
1938
  return false;
1939
  }
1940
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1941
  function formatEmailSetting(){
1942
  /*jshint validthis:true */
1943
  var val = jQuery(this).val();
@@ -3035,6 +3089,9 @@ function frmAdminBuildJS(){
3035
 
3036
  jQuery('.frm_form_settings').on('click', '.frm_add_form_logic', addFormLogicRow);
3037
  jQuery('.frm_form_settings').on('blur', '.frm_email_blur', formatEmailSetting);
 
 
 
3038
 
3039
  //Warning when user selects "Do not store entries ..."
3040
  jQuery(document.getElementById('no_save')).change(function(){
@@ -3472,16 +3529,17 @@ jQuery.ajax({
3472
  return false;
3473
  }
3474
 
3475
- function frmGetFieldValues(f,cur,r,t,n){
3476
- if(f){
3477
- jQuery.ajax({
3478
- type:'POST',url:ajaxurl,
3479
- data:'action=frm_get_field_values&current_field='+cur+'&field_id='+f+'&name='+n+'&t='+t+'&form_action='+jQuery('input[name="frm_action"]').val() +'&nonce='+frmGlobal.nonce,
3480
- success:function(msg){
3481
- document.getElementById('frm_show_selected_values_'+cur+'_'+r).innerHTML = msg;
3482
- }
3483
- });
3484
- }
 
3485
  }
3486
 
3487
  function frmImportCsv(formID){
890
  //Add new option or "Other" option to radio/checkbox/dropdown
891
  function addFieldOption(){
892
  /*jshint validthis:true */
893
+
894
+ // increment when the button is clicked too close together
895
+ var clicks = parseInt( this.dataset.clicks );
896
+ this.dataset.clicks = clicks + 1;
897
+
898
  var field_id = jQuery(this).closest('li').data('fid');
899
  var opt_type = jQuery(this).data('opttype');
900
  var opt_key = 1;
901
  var lastOpt = jQuery('#frm_field_'+ field_id +'_opts li:last');
902
  if(lastOpt.length){
903
  opt_key = lastOpt.attr('id').replace('frm_delete_field_'+ field_id +'-', '').replace('_container', '').replace('other_', '');
904
+ opt_key = parseInt(opt_key) + 1 + clicks;
905
  }
906
 
907
  //Update hidden field
1927
  var meta_name = 0;
1928
  var form_id = document.getElementById('form_id').value;
1929
  if(jQuery('#frm_form_action_'+id+' .frm_logic_row').length){
1930
+ meta_name = 1 + parseInt(jQuery('#frm_form_action_'+id+' .frm_logic_row:last').attr('id').replace('frm_logic_'+id+'_', ''));
1931
  }
1932
  jQuery.ajax({
1933
  type:'POST',url:ajaxurl,
1943
  return false;
1944
  }
1945
 
1946
+ /**
1947
+ * Adds submit button Conditional Logic row and reveals submit button Conditional Logic
1948
+ *
1949
+ * @returns {boolean}
1950
+ */
1951
+ function addSubmitLogic() {
1952
+ /*jshint validthis:true */
1953
+ var form_id = this_form_id;
1954
+ var meta_name = 0;
1955
+ if ( jQuery( '#frm_submit_logic_row .frm_logic_row' ).length > 0 ) {
1956
+ var last = jQuery( '#frm_submit_logic_row .frm_logic_row:last' );
1957
+ var submitRowID = last.attr( 'id' );
1958
+ var idFromSubmitRow = submitRowID.replace( 'frm_logic_submit_', '' );
1959
+
1960
+ meta_name = 1 + parseInt( last.attr( 'id' ).replace( 'frm_logic_submit_', '' ) );
1961
+ }
1962
+ jQuery.ajax( {
1963
+ type: 'POST',
1964
+ url: ajaxurl,
1965
+ data: {
1966
+ action: 'frm_add_submit_logic_row',
1967
+ form_id: form_id,
1968
+ meta_name: meta_name,
1969
+ nonce: frmGlobal.nonce
1970
+ },
1971
+ success: function ( html ) {
1972
+ jQuery( document.getElementById( 'logic_link_submit' ) ).fadeOut( 'slow', function () {
1973
+ var $logicRow = jQuery( document.getElementById( 'frm_submit_logic_row' ) );
1974
+ $logicRow.append( html );
1975
+ $logicRow.parent( '.frm_submit_logic_rows' ).fadeIn( 'slow' );
1976
+ } );
1977
+ }
1978
+ } );
1979
+ return false;
1980
+ }
1981
+
1982
+ /**
1983
+ * When the user selects a field for a submit condition, update corresponding options field accordingly.
1984
+ */
1985
+ function addSubmitLogicOpts() {
1986
+ var fieldOpt = jQuery( this );
1987
+ var field_id = fieldOpt.find( ':selected' ).val();
1988
+
1989
+ if ( field_id ) {
1990
+ var row = fieldOpt.data( 'row' );
1991
+ frmGetFieldValues( field_id, 'submit', row, '', 'options[submit_conditions][hide_opt][]' );
1992
+ }
1993
+ }
1994
+
1995
  function formatEmailSetting(){
1996
  /*jshint validthis:true */
1997
  var val = jQuery(this).val();
3089
 
3090
  jQuery('.frm_form_settings').on('click', '.frm_add_form_logic', addFormLogicRow);
3091
  jQuery('.frm_form_settings').on('blur', '.frm_email_blur', formatEmailSetting);
3092
+
3093
+ jQuery( '.frm_form_settings' ).on( 'click', '.frm_add_submit_logic', addSubmitLogic );
3094
+ jQuery( '.frm_form_settings' ).on( 'change', '.frm_submit_logic_field_opts', addSubmitLogicOpts );
3095
 
3096
  //Warning when user selects "Do not store entries ..."
3097
  jQuery(document.getElementById('no_save')).change(function(){
3529
  return false;
3530
  }
3531
 
3532
+ function frmGetFieldValues( field_id, cur, row_number, field_type, html_name ) {
3533
+
3534
+ if ( field_id ) {
3535
+ jQuery.ajax( {
3536
+ type: 'POST', url: ajaxurl,
3537
+ data: 'action=frm_get_field_values&current_field=' + cur + '&field_id=' + field_id + '&name=' + html_name + '&t=' + field_type + '&form_action=' + jQuery( 'input[name="frm_action"]' ).val() + '&nonce=' + frmGlobal.nonce,
3538
+ success: function ( msg ) {
3539
+ document.getElementById( 'frm_show_selected_values_' + cur + '_' + row_number ).innerHTML = msg;
3540
+ }
3541
+ } );
3542
+ }
3543
  }
3544
 
3545
  function frmImportCsv(formID){
languages/formidable.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Formidable v2.05\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2018-05-15 22:16+0000\n"
7
  "POT-Revision-Date: Tue Sep 26 2017 16:06:46 GMT-0600 (MDT)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: \n"
@@ -71,7 +71,7 @@ msgid ""
71
  "running the free version and remove this message."
72
  msgstr ""
73
 
74
- #: classes/controllers/FrmAppController.php:498
75
  #, php-format
76
  msgid ""
77
  "Help us spread the %1$sFormidable Forms%2$s love with %3$s %5$s on WordPress."
@@ -124,7 +124,7 @@ msgid "Entry Name"
124
  msgstr ""
125
 
126
  #: classes/controllers/FrmEntriesController.php:106
127
- #: classes/helpers/FrmCSVExportHelper.php:128
128
  msgid "Created By"
129
  msgstr ""
130
 
@@ -198,7 +198,7 @@ msgid "Form was Successfully Updated"
198
  msgstr ""
199
 
200
  #: classes/controllers/FrmFormsController.php:232
201
- #: classes/controllers/FrmFormsController.php:1629
202
  msgid "Form template was Successfully Created"
203
  msgstr ""
204
 
@@ -270,7 +270,7 @@ msgstr ""
270
 
271
  #: classes/controllers/FrmFormsController.php:624
272
  #: classes/controllers/FrmFormsController.php:628
273
- #: classes/helpers/FrmCSVExportHelper.php:133
274
  msgid "Key"
275
  msgstr ""
276
 
@@ -385,11 +385,11 @@ msgstr ""
385
  msgid "Please select a valid form"
386
  msgstr ""
387
 
388
- #: classes/controllers/FrmFormsController.php:1404
389
  msgid "Please wait while you are redirected."
390
  msgstr ""
391
 
392
- #: classes/controllers/FrmFormsController.php:1438
393
  #, php-format
394
  msgid "%1$sClick here%2$s if you are not automatically redirected."
395
  msgstr ""
@@ -675,7 +675,7 @@ msgid "Remove"
675
  msgstr ""
676
 
677
  #: classes/helpers/FrmAppHelper.php:1619
678
- #: classes/helpers/FrmCSVExportHelper.php:132
679
  msgid "ID"
680
  msgstr ""
681
 
@@ -708,8 +708,8 @@ msgid "(Click to add description)"
708
  msgstr ""
709
 
710
  #: classes/helpers/FrmAppHelper.php:1631
711
- #: classes/views/frm-fields/single-option.php:7
712
- #: classes/views/frm-fields/single-option.php:12
713
  msgid "(Blank)"
714
  msgstr ""
715
 
@@ -1087,44 +1087,48 @@ msgstr ""
1087
  msgid "Vietnamese"
1088
  msgstr ""
1089
 
1090
- #: classes/helpers/FrmCSVExportHelper.php:107
1091
  msgid "(label)"
1092
  msgstr ""
1093
 
1094
- #: classes/helpers/FrmCSVExportHelper.php:119
1095
  msgid "Comment"
1096
  msgstr ""
1097
 
1098
- #: classes/helpers/FrmCSVExportHelper.php:120
1099
  msgid "Comment User"
1100
  msgstr ""
1101
 
1102
- #: classes/helpers/FrmCSVExportHelper.php:121
1103
  msgid "Comment Date"
1104
  msgstr ""
1105
 
1106
- #: classes/helpers/FrmCSVExportHelper.php:126
1107
  msgid "Timestamp"
1108
  msgstr ""
1109
 
1110
- #: classes/helpers/FrmCSVExportHelper.php:127
1111
  msgid "Last Updated"
1112
  msgstr ""
1113
 
1114
- #: classes/helpers/FrmCSVExportHelper.php:129
1115
  msgid "Updated By"
1116
  msgstr ""
1117
 
1118
- #: classes/helpers/FrmCSVExportHelper.php:130
1119
  #: classes/helpers/FrmFormsHelper.php:943
1120
  #: classes/helpers/FrmFormsListHelper.php:363
1121
  msgid "Draft"
1122
  msgstr ""
1123
 
1124
- #: classes/helpers/FrmCSVExportHelper.php:131
1125
  msgid "IP"
1126
  msgstr ""
1127
 
 
 
 
 
1128
  #: classes/helpers/FrmEntriesHelper.php:456
1129
  #: classes/helpers/FrmEntriesHelper.php:457
1130
  msgid "Unknown"
@@ -2737,7 +2741,7 @@ msgid "%1$s Form submitted on %2$s"
2737
  msgstr ""
2738
 
2739
  #: classes/models/FrmEmail.php:299
2740
- #: classes/views/frm-entries/sidebar-shared.php:62
2741
  msgid "User Information"
2742
  msgstr ""
2743
 
@@ -2746,12 +2750,12 @@ msgid "User-Agent (Browser/OS)"
2746
  msgstr ""
2747
 
2748
  #: classes/models/FrmEmail.php:302 classes/models/FrmEntryValues.php:212
2749
- #: classes/views/frm-entries/sidebar-shared.php:80
2750
  msgid "Referrer"
2751
  msgstr ""
2752
 
2753
  #: classes/models/FrmEmail.php:318 classes/models/FrmEntryValues.php:202
2754
- #: classes/views/frm-entries/sidebar-shared.php:66
2755
  msgid "IP Address"
2756
  msgstr ""
2757
 
@@ -2936,6 +2940,14 @@ msgstr ""
2936
  msgid "Sending"
2937
  msgstr ""
2938
 
 
 
 
 
 
 
 
 
2939
  #: classes/models/FrmSettings.php:93
2940
  msgid "Your responses were successfully submitted. Thank you!"
2941
  msgstr ""
@@ -3167,17 +3179,17 @@ msgstr ""
3167
  msgid "Edit"
3168
  msgstr ""
3169
 
3170
- #: classes/views/frm-entries/sidebar-shared.php:46
3171
  #, php-format
3172
  msgid "Created by: %1$s"
3173
  msgstr ""
3174
 
3175
- #: classes/views/frm-entries/sidebar-shared.php:53
3176
  #, php-format
3177
  msgid "Updated by: %1$s"
3178
  msgstr ""
3179
 
3180
- #: classes/views/frm-entries/sidebar-shared.php:73
3181
  msgid "Browser/OS"
3182
  msgstr ""
3183
 
3
  msgstr ""
4
  "Project-Id-Version: Formidable v2.05\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2018-05-25 19:43+0000\n"
7
  "POT-Revision-Date: Tue Sep 26 2017 16:06:46 GMT-0600 (MDT)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: \n"
71
  "running the free version and remove this message."
72
  msgstr ""
73
 
74
+ #: classes/controllers/FrmAppController.php:500
75
  #, php-format
76
  msgid ""
77
  "Help us spread the %1$sFormidable Forms%2$s love with %3$s %5$s on WordPress."
124
  msgstr ""
125
 
126
  #: classes/controllers/FrmEntriesController.php:106
127
+ #: classes/helpers/FrmCSVExportHelper.php:134
128
  msgid "Created By"
129
  msgstr ""
130
 
198
  msgstr ""
199
 
200
  #: classes/controllers/FrmFormsController.php:232
201
+ #: classes/controllers/FrmFormsController.php:1630
202
  msgid "Form template was Successfully Created"
203
  msgstr ""
204
 
270
 
271
  #: classes/controllers/FrmFormsController.php:624
272
  #: classes/controllers/FrmFormsController.php:628
273
+ #: classes/helpers/FrmCSVExportHelper.php:139
274
  msgid "Key"
275
  msgstr ""
276
 
385
  msgid "Please select a valid form"
386
  msgstr ""
387
 
388
+ #: classes/controllers/FrmFormsController.php:1405
389
  msgid "Please wait while you are redirected."
390
  msgstr ""
391
 
392
+ #: classes/controllers/FrmFormsController.php:1439
393
  #, php-format
394
  msgid "%1$sClick here%2$s if you are not automatically redirected."
395
  msgstr ""
675
  msgstr ""
676
 
677
  #: classes/helpers/FrmAppHelper.php:1619
678
+ #: classes/helpers/FrmCSVExportHelper.php:138
679
  msgid "ID"
680
  msgstr ""
681
 
708
  msgstr ""
709
 
710
  #: classes/helpers/FrmAppHelper.php:1631
711
+ #: classes/views/frm-fields/single-option.php:8
712
+ #: classes/views/frm-fields/single-option.php:14
713
  msgid "(Blank)"
714
  msgstr ""
715
 
1087
  msgid "Vietnamese"
1088
  msgstr ""
1089
 
1090
+ #: classes/helpers/FrmCSVExportHelper.php:113
1091
  msgid "(label)"
1092
  msgstr ""
1093
 
1094
+ #: classes/helpers/FrmCSVExportHelper.php:125
1095
  msgid "Comment"
1096
  msgstr ""
1097
 
1098
+ #: classes/helpers/FrmCSVExportHelper.php:126
1099
  msgid "Comment User"
1100
  msgstr ""
1101
 
1102
+ #: classes/helpers/FrmCSVExportHelper.php:127
1103
  msgid "Comment Date"
1104
  msgstr ""
1105
 
1106
+ #: classes/helpers/FrmCSVExportHelper.php:132
1107
  msgid "Timestamp"
1108
  msgstr ""
1109
 
1110
+ #: classes/helpers/FrmCSVExportHelper.php:133
1111
  msgid "Last Updated"
1112
  msgstr ""
1113
 
1114
+ #: classes/helpers/FrmCSVExportHelper.php:135
1115
  msgid "Updated By"
1116
  msgstr ""
1117
 
1118
+ #: classes/helpers/FrmCSVExportHelper.php:136
1119
  #: classes/helpers/FrmFormsHelper.php:943
1120
  #: classes/helpers/FrmFormsListHelper.php:363
1121
  msgid "Draft"
1122
  msgstr ""
1123
 
1124
+ #: classes/helpers/FrmCSVExportHelper.php:137
1125
  msgid "IP"
1126
  msgstr ""
1127
 
1128
+ #: classes/helpers/FrmCSVExportHelper.php:141
1129
+ msgid "Parent ID"
1130
+ msgstr ""
1131
+
1132
  #: classes/helpers/FrmEntriesHelper.php:456
1133
  #: classes/helpers/FrmEntriesHelper.php:457
1134
  msgid "Unknown"
2741
  msgstr ""
2742
 
2743
  #: classes/models/FrmEmail.php:299
2744
+ #: classes/views/frm-entries/sidebar-shared.php:72
2745
  msgid "User Information"
2746
  msgstr ""
2747
 
2750
  msgstr ""
2751
 
2752
  #: classes/models/FrmEmail.php:302 classes/models/FrmEntryValues.php:212
2753
+ #: classes/views/frm-entries/sidebar-shared.php:90
2754
  msgid "Referrer"
2755
  msgstr ""
2756
 
2757
  #: classes/models/FrmEmail.php:318 classes/models/FrmEntryValues.php:202
2758
+ #: classes/views/frm-entries/sidebar-shared.php:76
2759
  msgid "IP Address"
2760
  msgstr ""
2761
 
2940
  msgid "Sending"
2941
  msgstr ""
2942
 
2943
+ #: classes/models/FrmPersonalData.php:23
2944
+ msgid "Formidable Forms Exporter"
2945
+ msgstr ""
2946
+
2947
+ #: classes/models/FrmPersonalData.php:61
2948
+ msgid "Form Submissions"
2949
+ msgstr ""
2950
+
2951
  #: classes/models/FrmSettings.php:93
2952
  msgid "Your responses were successfully submitted. Thank you!"
2953
  msgstr ""
3179
  msgid "Edit"
3180
  msgstr ""
3181
 
3182
+ #: classes/views/frm-entries/sidebar-shared.php:48
3183
  #, php-format
3184
  msgid "Created by: %1$s"
3185
  msgstr ""
3186
 
3187
+ #: classes/views/frm-entries/sidebar-shared.php:60
3188
  #, php-format
3189
  msgid "Updated by: %1$s"
3190
  msgstr ""
3191
 
3192
+ #: classes/views/frm-entries/sidebar-shared.php:83
3193
  msgid "Browser/OS"
3194
  msgstr ""
3195
 
readme.txt CHANGED
@@ -4,9 +4,9 @@ Tags: contact form, form builder, custom form, forms, form, form maker, form cre
4
  Requires at least: 4.4
5
  Tested up to: 4.9.5
6
  Requires PHP: 5.3
7
- Stable tag: 3.01.03
8
 
9
- The best WordPress forms plugin for custom forms. Go beyond contact forms with a drag & drop form builder, HTML control & form style generator.
10
 
11
  == Description ==
12
  = The best WordPress form builder plugin for custom forms =
@@ -159,6 +159,14 @@ The field and form names and descriptions are all changed with in-place edit. Ju
159
  [See more FAQs](https://formidableforms.com/formidable-faqs/ "Formidable Form FAQs")
160
 
161
  == Changelog ==
 
 
 
 
 
 
 
 
162
  = 3.01.03 =
163
  * Fix: Add responsive styling for the .frm_four_col class when grids are disabled
164
  * Fix: Fix number field HTML5 min, max, and step. This code was still in the pro form builder
4
  Requires at least: 4.4
5
  Tested up to: 4.9.5
6
  Requires PHP: 5.3
7
+ Stable tag: 3.02
8
 
9
+ The best WordPress forms plugin for custom forms. Go beyond contact forms with a drag & drop form builder, HTML control & form style generator
10
 
11
  == Description ==
12
  = The best WordPress form builder plugin for custom forms =
159
  [See more FAQs](https://formidableforms.com/formidable-faqs/ "Formidable Form FAQs")
160
 
161
  == Changelog ==
162
+ = 3.02 =
163
+ * New: Add support for WordPress export and erase personal data options for easier GDPR support
164
+ * Fix: HTML was getting stripped in field labels when a form was edited on the form builder page
165
+ * Fix: If a field option includes HTML, allow the HTML rather than sanitizing it with entities
166
+ * Fix: When the 'add option' button on the form builder is clicked multiple times, add the options correctly if the previous option isn't yes showing in the form maker
167
+ * Fix: The HTML for the link to the user profile was showing in the sidebar when editing or viewing an entry
168
+ * Code change: Move input classes into the field object class so it can be more easily overridden and amended. The FrmFieldType->get_input_class() function can be overriden in sub classes
169
+
170
  = 3.01.03 =
171
  * Fix: Add responsive styling for the .frm_four_col class when grids are disabled
172
  * Fix: Fix number field HTML5 min, max, and step. This code was still in the pro form builder