Formidable Forms – Form Builder for WordPress - Version 3.0.06

Version Description

Download this release

Release Info

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

Code changes from version 3.0.05 to 3.0.06

classes/controllers/FrmFieldsController.php CHANGED
@@ -210,6 +210,9 @@ class FrmFieldsController {
210
  * @param int $form_id
211
  */
212
  public static function load_single_field( $field_object, $values, $form_id = 0 ) {
 
 
 
213
  if ( is_numeric( $field_object ) ) {
214
  $field_object = FrmField::getOne( $field_object );
215
  } elseif ( is_array( $field_object ) ) {
@@ -234,6 +237,7 @@ class FrmFieldsController {
234
  $disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection;
235
 
236
  if ( ! isset( $field ) && is_object( $field_object ) ) {
 
237
  $field = FrmFieldsHelper::setup_edit_vars( $field_object );
238
  }
239
 
210
  * @param int $form_id
211
  */
212
  public static function load_single_field( $field_object, $values, $form_id = 0 ) {
213
+ global $frm_vars;
214
+ $frm_vars['is_admin'] = true;
215
+
216
  if ( is_numeric( $field_object ) ) {
217
  $field_object = FrmField::getOne( $field_object );
218
  } elseif ( is_array( $field_object ) ) {
237
  $disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection;
238
 
239
  if ( ! isset( $field ) && is_object( $field_object ) ) {
240
+ $field_object->parent_form_id = isset( $values['id'] ) ? $values['id'] : $field_object->form_id;
241
  $field = FrmFieldsHelper::setup_edit_vars( $field_object );
242
  }
243
 
classes/helpers/FrmAppHelper.php CHANGED
@@ -4,14 +4,14 @@ if ( ! defined('ABSPATH') ) {
4
  }
5
 
6
  class FrmAppHelper {
7
- public static $db_version = 86; //version of the database we are moving to
8
  public static $pro_db_version = 37; //deprecated
9
  public static $font_version = 3;
10
 
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '3.0.05';
15
 
16
  /**
17
  * @since 1.07.02
4
  }
5
 
6
  class FrmAppHelper {
7
+ public static $db_version = 87; //version of the database we are moving to
8
  public static $pro_db_version = 37; //deprecated
9
  public static $font_version = 3;
10
 
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '3.0.06';
15
 
16
  /**
17
  * @since 1.07.02
classes/helpers/FrmEntriesHelper.php CHANGED
@@ -408,12 +408,15 @@ class FrmEntriesHelper {
408
 
409
  // By default, the array keys will be numeric for multi-select dropdowns
410
  // If going backwards and forwards between pages, the array key will match the other key
411
- if ( $o_key != $other_key ) {
412
  unset( $value[ $o_key ] );
413
  }
414
 
415
  $args['temp_value'] = $value;
416
  $value[ $other_key ] = reset( $other_vals );
 
 
 
417
  }
418
  } else if ( $field->options[ $other_key ] == $value ) {
419
  $value = $other_vals;
408
 
409
  // By default, the array keys will be numeric for multi-select dropdowns
410
  // If going backwards and forwards between pages, the array key will match the other key
411
+ if ( $o_key !== $other_key ) {
412
  unset( $value[ $o_key ] );
413
  }
414
 
415
  $args['temp_value'] = $value;
416
  $value[ $other_key ] = reset( $other_vals );
417
+ if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
418
+ unset( $value[ $other_key ] );
419
+ }
420
  }
421
  } else if ( $field->options[ $other_key ] == $value ) {
422
  $value = $other_vals;
classes/helpers/FrmFormsHelper.php CHANGED
@@ -331,7 +331,7 @@ BEFORE_HTML;
331
  }
332
 
333
  public static function get_draft_link() {
334
- $link = '[if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
335
  return $link;
336
  }
337
 
@@ -719,7 +719,7 @@ BEFORE_HTML;
719
  if ( current_user_can('frm_delete_forms') ) {
720
  $actions['trash'] = $trash_links['delete'];
721
  }
722
- } else {
723
  $duplicate_link = '?page=formidable&frm_action=duplicate&id=' . $form_id;
724
  if ( $form->is_template ) {
725
  $actions['frm_duplicate'] = array(
@@ -727,7 +727,7 @@ BEFORE_HTML;
727
  'label' => __( 'Create Form from Template', 'formidable' ),
728
  'icon' => 'frm_icon_font frm_duplicate_icon',
729
  );
730
- } elseif ( FrmAppHelper::pro_is_installed() ) {
731
  $actions['duplicate'] = array(
732
  'url' => wp_nonce_url( $duplicate_link ),
733
  'label' => __( 'Duplicate Form', 'formidable' ),
331
  }
332
 
333
  public static function get_draft_link() {
334
+ $link = '[if save_draft]<a href="#" tabindex="0" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]';
335
  return $link;
336
  }
337
 
719
  if ( current_user_can('frm_delete_forms') ) {
720
  $actions['trash'] = $trash_links['delete'];
721
  }
722
+ } elseif ( current_user_can( 'frm_edit_forms' ) ) {
723
  $duplicate_link = '?page=formidable&frm_action=duplicate&id=' . $form_id;
724
  if ( $form->is_template ) {
725
  $actions['frm_duplicate'] = array(
727
  'label' => __( 'Create Form from Template', 'formidable' ),
728
  'icon' => 'frm_icon_font frm_duplicate_icon',
729
  );
730
+ } else {
731
  $actions['duplicate'] = array(
732
  'url' => wp_nonce_url( $duplicate_link ),
733
  'label' => __( 'Duplicate Form', 'formidable' ),
classes/models/FrmEmail.php CHANGED
@@ -178,11 +178,11 @@ class FrmEmail {
178
  $this->reply_to = trim( $this->settings['reply_to'] );
179
 
180
  if ( empty( $this->reply_to ) ) {
181
- $this->reply_to = $this->from;
182
  } else {
183
  $this->reply_to = $this->prepare_email_setting( $this->settings['reply_to'], $user_id_args );
184
- $this->reply_to = $this->format_reply_to( $this->reply_to );
185
  }
 
186
  }
187
 
188
  /**
@@ -558,7 +558,7 @@ class FrmEmail {
558
  }
559
  }
560
 
561
- $recipients[ $key ] = $name . ' <' . $email . '>';
562
  }
563
 
564
  return $recipients;
@@ -594,9 +594,7 @@ class FrmEmail {
594
  $from_email = 'wordpress@' . $sitename;
595
  }
596
 
597
- $from = $from_name . ' <' . $from_email . '>';
598
-
599
- return $from;
600
  }
601
 
602
  /**
@@ -611,15 +609,26 @@ class FrmEmail {
611
  private function format_reply_to( $reply_to ) {
612
  $reply_to = trim( $reply_to );
613
 
614
- if ( empty( $reply_to ) ) {
615
- return $this->from;
616
- } elseif ( is_email( $reply_to ) ) {
617
- return $reply_to;
618
- } else {
619
  list( $name, $email ) = $this->get_name_and_email_for_sender( $reply_to );
 
620
  }
621
 
622
- return $name . ' <' . $email . '>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  }
624
 
625
  /**
@@ -646,6 +655,16 @@ class FrmEmail {
646
  return array( $name, $end );
647
  }
648
 
 
 
 
 
 
 
 
 
 
 
649
  /**
650
  * Remove phone numbers from To addresses
651
  * Send the phone numbers to the frm_send_to_not_email hook
178
  $this->reply_to = trim( $this->settings['reply_to'] );
179
 
180
  if ( empty( $this->reply_to ) ) {
181
+ $this->reply_to = $this->get_email_from_name( $this->from );
182
  } else {
183
  $this->reply_to = $this->prepare_email_setting( $this->settings['reply_to'], $user_id_args );
 
184
  }
185
+ $this->reply_to = $this->format_reply_to( $this->reply_to );
186
  }
187
 
188
  /**
558
  }
559
  }
560
 
561
+ $recipients[ $key ] = $this->format_from_email( $name, $email );
562
  }
563
 
564
  return $recipients;
594
  $from_email = 'wordpress@' . $sitename;
595
  }
596
 
597
+ return $this->format_from_email( $from_name, $from_email );
 
 
598
  }
599
 
600
  /**
609
  private function format_reply_to( $reply_to ) {
610
  $reply_to = trim( $reply_to );
611
 
612
+ if ( ! is_email( $reply_to ) ) {
 
 
 
 
613
  list( $name, $email ) = $this->get_name_and_email_for_sender( $reply_to );
614
+ $reply_to = $this->format_from_email( $name, $email );
615
  }
616
 
617
+ return $reply_to;
618
+ }
619
+
620
+ /**
621
+ * Get only the email if the name and email have been combined
622
+ *
623
+ * @since 3.0.06
624
+ */
625
+ private function get_email_from_name( $name ) {
626
+ $email = trim( trim( $name, '>' ), '<' );
627
+ if ( strpos( $email, '<' ) !== false ) {
628
+ $parts = explode( '<', $email );
629
+ $email = trim( $parts[1], '>' );
630
+ }
631
+ return $email;
632
  }
633
 
634
  /**
655
  return array( $name, $end );
656
  }
657
 
658
+ /**
659
+ * @since 3.0.06
660
+ */
661
+ private function format_from_email( $name, $email ) {
662
+ if ( '' !== $name ) {
663
+ $email = $name . ' <' . $email . '>';
664
+ }
665
+ return $email;
666
+ }
667
+
668
  /**
669
  * Remove phone numbers from To addresses
670
  * Send the phone numbers to the frm_send_to_not_email hook
classes/models/FrmEntryFormatter.php CHANGED
@@ -486,7 +486,8 @@ class FrmEntryFormatter {
486
  $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
487
  $output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
488
 
489
- if ( $displayed_value !== $field_value->get_saved_value() ) {
 
490
  $output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
491
  }
492
  }
486
  $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
487
  $output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
488
 
489
+ $has_separate_value = (bool) $field_value->get_field_option( 'separate_value' );
490
+ if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) {
491
  $output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
492
  }
493
  }
classes/models/FrmEntryValidate.php CHANGED
@@ -87,7 +87,7 @@ class FrmEntryValidate {
87
  $value = trim( $value );
88
  }
89
 
90
- if ( $posted_field->required == '1' && ! is_array( $value ) && trim( $value ) == '' ) {
91
  $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
92
  } else if ( $posted_field->type == 'text' && ! isset( $_POST['item_name'] ) ) {
93
  $_POST['item_name'] = $value;
87
  $value = trim( $value );
88
  }
89
 
90
+ if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) {
91
  $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
92
  } else if ( $posted_field->type == 'text' && ! isset( $_POST['item_name'] ) ) {
93
  $_POST['item_name'] = $value;
classes/models/FrmField.php CHANGED
@@ -925,17 +925,4 @@ class FrmField {
925
  ( 'lookup' === $field_type && $is_type === $data_type )
926
  );
927
  }
928
-
929
- /**
930
- * Check if a field might by taller than other fields
931
- * @since 3.0
932
- *
933
- * @param array|object $field
934
- *
935
- * @return bool
936
- */
937
- public static function is_tall_field( $field ) {
938
- $field_type = FrmField::get_field_type( $field );
939
- return FrmFieldFactory::field_has_property( $field_type, 'is_tall' );
940
- }
941
  }
925
  ( 'lookup' === $field_type && $is_type === $data_type )
926
  );
927
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
928
  }
classes/models/FrmMigrate.php CHANGED
@@ -200,7 +200,7 @@ class FrmMigrate {
200
  return;
201
  }
202
 
203
- $migrations = array( 6, 11, 16, 17, 23, 25, 86 );
204
  foreach ( $migrations as $migration ) {
205
  if ( FrmAppHelper::$db_version >= $migration && $old_db_version < $migration ) {
206
  $function_name = 'migrate_to_' . $migration;
@@ -511,43 +511,4 @@ DEFAULT_HTML;
511
  unset($form);
512
  }
513
  }
514
-
515
- private function migrate_to_6() {
516
- global $wpdb;
517
-
518
- $no_save = array_merge( FrmField::no_save_fields(), array( 'form', 'hidden', 'user_id' ) );
519
- $fields = FrmDb::get_results( $this->fields, array( 'type NOT' => $no_save ), 'id, field_options' );
520
-
521
- $default_html = <<<DEFAULT_HTML
522
- <div id="frm_field_[id]_container" class="form-field [required_class] [error_class]">
523
- <label class="frm_pos_[label_position]">[field_name]
524
- <span class="frm_required">[required_label]</span>
525
- </label>
526
- [input]
527
- [if description]<div class="frm_description">[description]</div>[/if description]
528
- </div>
529
- DEFAULT_HTML;
530
-
531
- $old_default_html = <<<DEFAULT_HTML
532
- <div id="frm_field_[id]_container" class="form-field [required_class] [error_class]">
533
- <label class="frm_pos_[label_position]">[field_name]
534
- <span class="frm_required">[required_label]</span>
535
- </label>
536
- [input]
537
- [if description]<p class="frm_description">[description]</p>[/if description]
538
- </div>
539
- DEFAULT_HTML;
540
-
541
- $new_default_html = FrmFieldsHelper::get_default_html('text');
542
- foreach ( $fields as $field ) {
543
- $field->field_options = maybe_unserialize($field->field_options);
544
- $html = FrmField::get_option( $field, 'custom_html' );
545
- if ( $html == $default_html || $html == $old_default_html ) {
546
- $field->field_options['custom_html'] = $new_default_html;
547
- $wpdb->update( $this->fields, array( 'field_options' => maybe_serialize( $field->field_options ) ), array( 'id' => $field->id ) );
548
- }
549
- unset($field);
550
- }
551
- unset($default_html, $old_default_html, $fields);
552
- }
553
  }
200
  return;
201
  }
202
 
203
+ $migrations = array( 16, 11, 16, 17, 23, 25, 86 );
204
  foreach ( $migrations as $migration ) {
205
  if ( FrmAppHelper::$db_version >= $migration && $old_db_version < $migration ) {
206
  $function_name = 'migrate_to_' . $migration;
511
  unset($form);
512
  }
513
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  }
classes/models/fields/FrmFieldCaptcha.php CHANGED
@@ -17,8 +17,6 @@ class FrmFieldCaptcha extends FrmFieldType {
17
  */
18
  protected $has_for_label = false;
19
 
20
- protected $is_tall = true;
21
-
22
  /**
23
  * @return string
24
  */
17
  */
18
  protected $has_for_label = false;
19
 
 
 
20
  /**
21
  * @return string
22
  */
classes/models/fields/FrmFieldCheckbox.php CHANGED
@@ -17,8 +17,6 @@ class FrmFieldCheckbox extends FrmFieldType {
17
  */
18
  protected $holds_email_values = true;
19
 
20
- protected $is_tall = true;
21
-
22
  protected function input_html() {
23
  return $this->multiple_input_html();
24
  }
17
  */
18
  protected $holds_email_values = true;
19
 
 
 
20
  protected function input_html() {
21
  return $this->multiple_input_html();
22
  }
classes/models/fields/FrmFieldHTML.php CHANGED
@@ -17,8 +17,6 @@ class FrmFieldHTML extends FrmFieldType {
17
  */
18
  protected $has_input = false;
19
 
20
- protected $is_tall = true;
21
-
22
  public function default_html() {
23
  return '<div id="frm_field_[id]_container" class="frm_form_field form-field">[description]</div>';
24
  }
17
  */
18
  protected $has_input = false;
19
 
 
 
20
  public function default_html() {
21
  return '<div id="frm_field_[id]_container" class="frm_form_field form-field">[description]</div>';
22
  }
classes/models/fields/FrmFieldRadio.php CHANGED
@@ -17,8 +17,6 @@ class FrmFieldRadio extends FrmFieldType {
17
  */
18
  protected $holds_email_values = true;
19
 
20
- protected $is_tall = true;
21
-
22
  protected function input_html() {
23
  return $this->multiple_input_html();
24
  }
17
  */
18
  protected $holds_email_values = true;
19
 
 
 
20
  protected function input_html() {
21
  return $this->multiple_input_html();
22
  }
classes/models/fields/FrmFieldTextarea.php CHANGED
@@ -11,8 +11,6 @@ class FrmFieldTextarea extends FrmFieldType {
11
  */
12
  protected $type = 'textarea';
13
 
14
- protected $is_tall = true;
15
-
16
  protected function field_settings_for_type() {
17
  return array(
18
  'size' => true,
11
  */
12
  protected $type = 'textarea';
13
 
 
 
14
  protected function field_settings_for_type() {
15
  return array(
16
  'size' => true,
classes/views/frm-entries/errors.php CHANGED
@@ -6,7 +6,7 @@ if ( isset($include_extra_container) ) { ?>
6
  if ( isset( $message ) && $message != '' ) {
7
  if ( FrmAppHelper::is_admin() ) {
8
  ?>
9
- <div id="message" class="frm_message updated"><?php echo wp_kses_post( $message ) ?></div>
10
  <?php
11
  } else {
12
  FrmFormsHelper::maybe_get_scroll_js( $form->id );
6
  if ( isset( $message ) && $message != '' ) {
7
  if ( FrmAppHelper::is_admin() ) {
8
  ?>
9
+ <div id="message" class="frm_updated_message updated"><?php echo wp_kses_post( $message ) ?></div>
10
  <?php
11
  } else {
12
  FrmFormsHelper::maybe_get_scroll_js( $form->id );
classes/views/frm-fields/front-end/checkbox-field.php CHANGED
@@ -28,7 +28,7 @@ if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' )
28
  ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php
29
  }
30
 
31
- ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php
32
 
33
  if ( ! isset( $shortcode_atts ) || ! isset( $shortcode_atts['label'] ) || $shortcode_atts['label'] ) {
34
  echo ' ' . $opt . '</label>';
28
  ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php
29
  }
30
 
31
+ ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>"<?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php
32
 
33
  if ( ! isset( $shortcode_atts ) || ! isset( $shortcode_atts['label'] ) || $shortcode_atts['label'] ) {
34
  echo ' ' . $opt . '</label>';
css/_single_theme.css.php CHANGED
@@ -222,6 +222,7 @@ if ( '' === $field_height || 'auto' === $field_height ) {
222
  grid-template-columns: auto 25%;
223
  }
224
 
 
225
  .<?php echo esc_html( $style_class ) ?> .frm_inline_container.frm_dynamic_select_container .frm_opt_container{
226
  display:inline<?php echo esc_html( $important ) ?>;
227
  }
@@ -415,6 +416,7 @@ if ( ! empty( $important ) ) {
415
  .<?php echo esc_html( $style_class ) ?> .frm_focus_field input[type=tel],
416
  .<?php echo esc_html( $style_class ) ?> .frm_focus_field input[type=search],
417
  .frm_form_fields_active_style,
 
418
  .<?php echo esc_html( $style_class ) ?> .chosen-container-active .chosen-choices{
419
  background-color:#<?php echo esc_html( $bg_color_active . $important ); ?>;
420
  border-color:#<?php echo esc_html( $border_color_active . $important ) ?>;
222
  grid-template-columns: auto 25%;
223
  }
224
 
225
+ .<?php echo esc_html( $style_class ) ?> .frm_inline_container.frm_dynamic_select_container .frm_data_container,
226
  .<?php echo esc_html( $style_class ) ?> .frm_inline_container.frm_dynamic_select_container .frm_opt_container{
227
  display:inline<?php echo esc_html( $important ) ?>;
228
  }
416
  .<?php echo esc_html( $style_class ) ?> .frm_focus_field input[type=tel],
417
  .<?php echo esc_html( $style_class ) ?> .frm_focus_field input[type=search],
418
  .frm_form_fields_active_style,
419
+ .<?php echo esc_html( $style_class ) ?> .chosen-container-single.chosen-container-active .chosen-single,
420
  .<?php echo esc_html( $style_class ) ?> .chosen-container-active .chosen-choices{
421
  background-color:#<?php echo esc_html( $bg_color_active . $important ); ?>;
422
  border-color:#<?php echo esc_html( $border_color_active . $important ) ?>;
css/frm_admin.css CHANGED
@@ -25,7 +25,8 @@ a.frm_confirming,
25
  margin-bottom:0;
26
  background:#fff;
27
  flex: 1 1 auto;
28
- overflow: auto;
 
29
  width: auto;
30
  }
31
 
25
  margin-bottom:0;
26
  background:#fff;
27
  flex: 1 1 auto;
28
+ overflow-y: auto;
29
+ overflow-x: hidden;
30
  width: auto;
31
  }
32
 
css/frm_grids.css CHANGED
@@ -201,6 +201,7 @@
201
  .frm_form_field.frm_alignright{
202
  grid-column-end:-1;
203
  grid-row-start: span 100;
 
204
  }
205
 
206
  /* RTL Grids */
201
  .frm_form_field.frm_alignright{
202
  grid-column-end:-1;
203
  grid-row-start: span 100;
204
+ justify-content: end;
205
  }
206
 
207
  /* RTL Grids */
css/frm_old_grids.css CHANGED
@@ -206,16 +206,19 @@
206
  width:auto !important;
207
  }
208
 
 
 
 
 
 
 
209
  .frm_combo_inputs_container,
210
  .frm_grid_container,
211
  .frm_form_fields .frm_section_heading,
212
  .frm_form_fields .frm_fields_container,
213
  .frm_form_field.frm_two_col .frm_opt_container,
214
  .frm_form_field.frm_three_col .frm_opt_container,
215
- .frm_form_field.frm_four_col .frm_opt_container,
216
- .frm_form_field.frm_inline_container,
217
- .frm_form_field.frm_right_container,
218
- .frm_form_field.frm_left_container{
219
  display:block;
220
  }
221
 
@@ -261,6 +264,9 @@
261
  max-width:100%;
262
  }
263
 
 
 
 
264
  .frm_form_field.frm_left_container .frm_opt_container,
265
  .frm_form_field.frm_right_container .frm_opt_container,
266
  .frm_form_field.frm_inline_container .frm_opt_container,
206
  width:auto !important;
207
  }
208
 
209
+ .frm_form_field.frm_inline_container,
210
+ .frm_form_field.frm_right_container,
211
+ .frm_form_field.frm_left_container{
212
+ display:inline-block;
213
+ }
214
+
215
  .frm_combo_inputs_container,
216
  .frm_grid_container,
217
  .frm_form_fields .frm_section_heading,
218
  .frm_form_fields .frm_fields_container,
219
  .frm_form_field.frm_two_col .frm_opt_container,
220
  .frm_form_field.frm_three_col .frm_opt_container,
221
+ .frm_form_field.frm_four_col .frm_opt_container{
 
 
 
222
  display:block;
223
  }
224
 
264
  max-width:100%;
265
  }
266
 
267
+ .frm_form_field.frm_left_container .frm_data_container,
268
+ .frm_form_field.frm_right_container .frm_data_container,
269
+ .frm_form_field.frm_inline_container .frm_data_container,
270
  .frm_form_field.frm_left_container .frm_opt_container,
271
  .frm_form_field.frm_right_container .frm_opt_container,
272
  .frm_form_field.frm_inline_container .frm_opt_container,
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.0.05
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.0.06
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -150,25 +150,6 @@ function frmFrontFormJS(){
150
  return errors;
151
  }
152
 
153
- function fieldValueChanged(e){
154
- /*jshint validthis:true */
155
-
156
- var field_id = frmFrontForm.getFieldId( this, false );
157
- if ( ! field_id || typeof field_id === 'undefined' ) {
158
- return;
159
- }
160
-
161
- if ( e.frmTriggered && e.frmTriggered == field_id ) {
162
- return;
163
- }
164
-
165
- jQuery(document).trigger( 'frmFieldChanged', [ this, field_id, e ] );
166
-
167
- if ( e.selfTriggered !== true ) {
168
- maybeValidateChange( field_id, this );
169
- }
170
- }
171
-
172
  function maybeValidateChange( field_id, field ) {
173
  if ( jQuery(field).closest('form').hasClass('frm_js_validate') ) {
174
  validateField( field_id, field );
@@ -796,7 +777,7 @@ function frmFrontFormJS(){
796
 
797
  jQuery(document.getElementById('frm_resend_email')).click(resendEmail);
798
 
799
- 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"]', fieldValueChanged );
800
  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', maybeShowLabel);
801
 
802
  jQuery(document).on('click', 'a[data-frmconfirm]', confirmClick);
@@ -1006,6 +987,25 @@ function frmFrontFormJS(){
1006
  }
1007
  },
1008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1009
  savingDraft: function(object){
1010
  console.warn('DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft');
1011
  if ( typeof frmProForm !== 'undefined' ) {
150
  return errors;
151
  }
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  function maybeValidateChange( field_id, field ) {
154
  if ( jQuery(field).closest('form').hasClass('frm_js_validate') ) {
155
  validateField( field_id, field );
777
 
778
  jQuery(document.getElementById('frm_resend_email')).click(resendEmail);
779
 
780
+ 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 );
781
  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', maybeShowLabel);
782
 
783
  jQuery(document).on('click', 'a[data-frmconfirm]', confirmClick);
987
  }
988
  },
989
 
990
+ fieldValueChanged: function(e){
991
+ /*jshint validthis:true */
992
+
993
+ var field_id = frmFrontForm.getFieldId( this, false );
994
+ if ( ! field_id || typeof field_id === 'undefined' ) {
995
+ return;
996
+ }
997
+
998
+ if ( e.frmTriggered && e.frmTriggered == field_id ) {
999
+ return;
1000
+ }
1001
+
1002
+ jQuery(document).trigger( 'frmFieldChanged', [ this, field_id, e ] );
1003
+
1004
+ if ( e.selfTriggered !== true ) {
1005
+ maybeValidateChange( field_id, this );
1006
+ }
1007
+ },
1008
+
1009
  savingDraft: function(object){
1010
  console.warn('DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft');
1011
  if ( typeof frmProForm !== 'undefined' ) {
js/formidable.min.js CHANGED
@@ -1,30 +1,30 @@
1
  function frmFrontFormJS(){function f(){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 e(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 k(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&&
3
- 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=n(this,a));if(1>a.length)if("email"===this.type){var c=jQuery(this).closest("form").find("input[type=email]");a=v(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)t(b,d,a)}}
4
- function n(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"),jQuery(c).each(function(){d=this.value});else if("file"===a.type||c)"undefined"===typeof c&&(c=e(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=p(c)),h=c;else{c=a.className;if(-1!==c.indexOf("frm_pos_none"))return b;d=jQuery(a).val();if(null===d)d="";
5
- else if("string"!==typeof d){h=d;d="";for(var l=0;l<h.length;l++)""!==h[l]&&(d=h[l])}h=-1===c.indexOf("frm_other_input")?e(a,!0):e(a,!1);-1!==c.indexOf("frm_time_select")&&(h=h.replace("-H","").replace("-m",""))}""===d&&(""===h&&(h=e(a,!0)),h in b||(b[h]=q(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 v(a,b,c){var d=a.value,h=e(a,!0);if(h in
6
- b)return b;var l=0===h.indexOf("conf_");if(""!==d||l){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,f=q(a,"data-invmsg");""!==d&&!1===g.test(d)?(b[h]=f,l&&(b[h.replace("conf_","")]="")):l&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[h]="",b[h.replace("conf_","")]=""))}return b}function w(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=e(a,!0),c in b||(b[c]=q(a,
7
- "data-invmsg")));return b}function x(a,b){var c=a.value,d=q(a,"pattern");if(""!==d&&""!==c){var h=e(a,!0);h in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[h]=q(a,"data-invmsg")))}return b}function q(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_"+
8
- 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",[a,b]),window.location=b.redirect;else if(""!==b.content){u(jQuery(a));-1!=frm_js.offset&&frmFrontForm.scrollMsg(jQuery(a),!1);var l=jQuery(a).find('input[name="form_id"]').val();b.content=b.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");
9
- jQuery(a).closest(".frm_forms").replaceWith(b.content);d=b;if(history.pushState&&"undefined"!==typeof d.page){var g=d.page;var f=encodeURI("frm_page");g=encodeURI(g);for(var e=document.location.search.substr(1).split("&"),k=e.length,m;k--;)if(m=e[k].split("="),m[0]==f){m[1]=g;e[k]=m.join("=");break}0>k&&(e[e.length]=[f,g].join("="));f=e.join("&");window.history.pushState({html:d.html},"","?"+f)}"function"===typeof frmThemeOverride_frmAfterSubmit&&(l=jQuery('input[name="frm_page_order_'+l+'"]').val(),
10
- d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,l,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){u(jQuery(a),"enable");d=!0;y();f=!1;for(l in b.errors)g=jQuery(a).find("#frm_field_"+l+"_container"),g.length&&(g.is(":visible")||(e=g.closest(".frm_toggle_container"),e.length&&(e=e.prev(),e.hasClass("frm_trigger")||
11
- (e=e.prev(".frm_trigger")),e.click())),g.is(":visible")&&(t(g,l,b.errors),d=!1,g=jQuery(a).find("#frm_field_"+l+"_container .frm-g-recaptcha, #frm_field_"+l+"_container .g-recaptcha"),g.length&&(f=!0,g=g.data("rid"),jQuery().grecaptcha&&(g?grecaptcha.reset(g):grecaptcha.reset()))));jQuery(document).trigger("frmFormErrors",[a,b]);c.removeClass("frm_doing_ajax");z(a);!0!==f&&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");
12
- a.submit()}})}function t(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");
13
- 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 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");
14
- 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")}
15
- 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)}});
16
- 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=
17
- 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",
18
- ".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"]',
19
- k);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",f);jQuery(document).on("click","a[data-frmconfirm]",I);jQuery("a[data-frmtoggle]").click(J);K();L();M();N()},getFieldId:function(a,b){return e(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();
20
- 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=
21
- !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,
22
- 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");b&&"undefined"!==typeof frmProForm&&
23
- (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=n(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");d=jQuery(a).find("input,select,textarea");
24
- 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=w(g,b):"email"===g.type?b=v(g,b,c):null!==g.pattern&&(b=x(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&&(r=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(r,
25
- a),Object.keys(a).length))for(var k in a)m[k]=a[k];return m},addAjaxFormErrors:function(a){y();for(var b in m){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?t(c,b,m):delete m[b]}z(a)},checkFormErrors:function(a,b){D(a,b)},checkRequiredField:function(a,b){return n(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=
26
- 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},
27
- 500),!1}},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");if("undefined"!==typeof frmProForm)return frmProForm.goingToPreviousPage(a)},hideOrShowFields:function(a,b){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");
28
  "undefined"!==typeof frmProForm&&frmProForm.hideOrShowFields()},hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");"undefined"!==typeof frmProForm&&frmProForm.hidePreviouslyHiddenFields()},checkDependentDynamicFields:function(a){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");"undefined"!==typeof frmProForm&&
29
  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");frmProForm.loadGoogle()},removeUsedTimes:function(a,b){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes in v3.0 use frmProForm.removeUsedTimes");
30
  "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")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(f){frmFrontForm.init()});
1
  function frmFrontFormJS(){function f(){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 e(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 k(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=e(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 l=0;l<h.length;l++)""!==h[l]&&(d=h[l])}h=-1===c.indexOf("frm_other_input")?e(a,!0):e(a,!1);-1!==c.indexOf("frm_time_select")&&(h=h.replace("-H","").replace("-m",""))}""===d&&(""===h&&(h=e(a,!0)),
4
+ h in b||(b[h]=q(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 p(a,b,c){var d=a.value,h=e(a,!0);if(h in b)return b;var l=0===h.indexOf("conf_");if(""!==d||l){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,f=q(a,"data-invmsg");""!==
5
+ d&&!1===g.test(d)?(b[h]=f,l&&(b[h.replace("conf_","")]="")):l&&(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=e(a,!0),c in b||(b[c]=q(a,"data-invmsg")));return b}function w(a,b){var c=a.value,d=q(a,"pattern");if(""!==d&&""!==c){var h=e(a,!0);h in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[h]=q(a,"data-invmsg")))}return b}function q(a,b){var c=a.getAttribute(b);null===
6
+ c&&(c="");return c}function C(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){t(jQuery(a));-1!=frm_js.offset&&frmFrontForm.scrollMsg(jQuery(a),!1);var l=jQuery(a).find('input[name="form_id"]').val();b.content=b.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");jQuery(a).closest(".frm_forms").replaceWith(b.content);d=b;if(history.pushState&&"undefined"!==typeof d.page){var g=d.page;var f=encodeURI("frm_page");g=encodeURI(g);for(var e=document.location.search.substr(1).split("&"),k=e.length,m;k--;)if(m=e[k].split("="),
8
+ m[0]==f){m[1]=g;e[k]=m.join("=");break}0>k&&(e[e.length]=[f,g].join("="));f=e.join("&");window.history.pushState({html:d.html},"","?"+f)}"function"===typeof frmThemeOverride_frmAfterSubmit&&(l=jQuery('input[name="frm_page_order_'+l+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,l,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),
9
+ "enable");d=!0;x();f=!1;for(l in b.errors)g=jQuery(a).find("#frm_field_"+l+"_container"),g.length&&(g.is(":visible")||(e=g.closest(".frm_toggle_container"),e.length&&(e=e.prev(),e.hasClass("frm_trigger")||(e=e.prev(".frm_trigger")),e.click())),g.is(":visible")&&(u(g,l,b.errors),d=!1,g=jQuery(a).find("#frm_field_"+l+"_container .frm-g-recaptcha, #frm_field_"+l+"_container .g-recaptcha"),g.length&&(f=!0,g=g.data("rid"),jQuery().grecaptcha&&(g?grecaptcha.reset(g):grecaptcha.reset()))));jQuery(document).trigger("frmFormErrors",
10
+ [a,b]);c.removeClass("frm_doing_ajax");y(a);!0!==f&&z(a,!1);d?a.submit():jQuery(a).prepend(b.error_message)}else D(a),z(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");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",
11
+ [a,b,c]))}function x(){jQuery(".form-field").removeClass("frm_blank_field has-error");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function y(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function A(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,
12
+ 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 D(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")},2E3))}function z(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||
13
+ 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 E(){B(jQuery(this),"clear")}function F(){B(jQuery(this),"replace")}function B(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 G(){var a=
14
+ 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 H(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function I(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function J(){Array.prototype.indexOf||
15
+ (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 K(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function L(){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;
16
+ 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 M(){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",".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()});
17
+ jQuery(document).on("focus",".frm_toggle_default",E);jQuery(document).on("blur",".frm_toggle_default",F);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(G);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);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",
18
+ f);jQuery(document).on("click","a[data-frmconfirm]",H);jQuery("a[data-frmtoggle]").click(I);J();K();L();M()},getFieldId:function(a,b){return e(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();c.callback=function(a){frmFrontForm.afterRecaptcha(a,d)}}b=grecaptcha.render(a.id,c);a.setAttribute("data-rid",b)},afterSingleRecaptcha:function(a){a=
19
+ 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=!1;else{var d=jQuery(b).find('.frm-g-recaptcha[data-size="invisible"], .g-recaptcha[data-size="invisible"]');d.length?(c=d.data("rid"),
20
+ 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&&(A(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?
21
+ (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");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=
22
+ [],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=k(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");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=p(g,b,c):null!==g.pattern&&(b=w(g,b)))}}c=jQuery(a).find(".frm-g-recaptcha");
23
+ 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&&(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){x();for(var b in m){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?u(c,b,m):delete m[b]}y(a)},
24
+ checkFormErrors:function(a,b){C(a,b)},checkRequiredField:function(a,b){return k(a,b)},showSubmitLoading:function(a){A(a)},removeSubmitLoading:function(a,b,c){t(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=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;
25
+ 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},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",
26
+ [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=k(this,a));if(1>a.length)if("email"===this.type){var c=jQuery(this).closest("form").find("input[type=email]");a=p(this,a,c)}else"number"===this.type?a=v(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,
27
+ 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");if("undefined"!==typeof frmProForm)return frmProForm.goingToPreviousPage(a)},hideOrShowFields:function(a,b){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");
28
  "undefined"!==typeof frmProForm&&frmProForm.hideOrShowFields()},hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");"undefined"!==typeof frmProForm&&frmProForm.hidePreviouslyHiddenFields()},checkDependentDynamicFields:function(a){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");"undefined"!==typeof frmProForm&&
29
  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");frmProForm.loadGoogle()},removeUsedTimes:function(a,b){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes in v3.0 use frmProForm.removeUsedTimes");
30
  "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")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(f){frmFrontForm.init()});
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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
6
  Requires PHP: 5.3
7
- Stable tag: 3.0.05
8
 
9
  The best WordPress form plugin for contact forms, surveys and more. Make forms a breeze with a drag and drop form builder and form style generator.
10
 
@@ -159,6 +159,12 @@ 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.0.05 =
163
  * Fix: The visual form styler didn't look good when CSS grids were turned off
164
  * Fix: Prevent past database migrations from being run again. This was making some field sizes much larger.
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
  Requires PHP: 5.3
7
+ Stable tag: 3.0.06
8
 
9
  The best WordPress form plugin for contact forms, surveys and more. Make forms a breeze with a drag and drop form builder and form style generator.
10
 
159
  [See more FAQs](https://formidableforms.com/formidable-faqs/ "Formidable Form FAQs")
160
 
161
  == Changelog ==
162
+ - 3.0.06 =
163
+ * New: Include the option to duplicate a form in the free form builder
164
+ * Fix: If the reply to address in the email is not specified, use only the from email without the from name to increase receivability
165
+ * Fix: Improve styling without CSS grids when using left, right, and inline labels
166
+ * Fix: Make the frmFrontForm.fieldValueChanged function public in the javascript so it can be triggered by scripts in other plugins
167
+
168
  = 3.0.05 =
169
  * Fix: The visual form styler didn't look good when CSS grids were turned off
170
  * Fix: Prevent past database migrations from being run again. This was making some field sizes much larger.