Formidable Forms – Form Builder for WordPress - Version 2.0.11

Version Description

  • Fix issue with clearing array keys when sanitizing an array when displaying entry values
  • When the email "reply to" value uses the "from" setting, only use the email address without the name
  • Switch the form action events to dropdown instead of checkboxes
  • Shrink the reCaptcha on small screens
  • Add font-weight 100-900 options to styler
  • Add frm_email_message filter
  • Fixes for javascript errors while form building in IE8
  • Only load font.css for the admin bar when user can edit forms
  • Add frm_include_form_tag filter for using div instead of form tag
  • Add frm_show_submit_button filter for hiding and showing the submit button
  • Fix date calculations using date formats that begin with the year
  • Allow classes to be included on a hidden input
  • Process the entry a little sooner (wp_loaded instead of wp)
  • Add frm_capitalize layout class
  • Make frm_customize class work for more field types
  • Pro Features:
  • Set new views to private by default
  • Allow clickable=1 in the frm-show-entry shortcode
  • Make sure to show the Add row button for repeating sections in IE9
  • Correctly require a password before showing password protected views
  • Add update_single_field function for easier updating of a single field
  • Add frm_datepicker_formats hook for adding format additional options on the Formidable -> global settings page
  • Add frm_csv_row hook for adding data to a row in the CSV
  • Keep the Pending status selected after save in the post settings
  • Add frm_is_dynamic_field_empty filter for overriding whether a dependent dynamic field is available for validation or if the value should be cleared
  • Improve dragging and dropping large sections of fields
  • Don't trigger form actions while importing
  • Make sure $entry_ids is still intact for the frm_after_content hook
  • Replace m/d/Y format option
  • Fix updating a field with the frm-entry-update-field shortcode
  • Work on calculating different combinations of fields inside and outside a repeating section
  • Only return unique values when a list field is displayed based on checkboxes
  • Fix searching entries with a trailing space
  • Fix truncating in the dynamic content
Download this release

Release Info

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

Code changes from version 2.0.10 to 2.0.11

Files changed (38) hide show
  1. classes/controllers/FrmEntriesController.php +2 -2
  2. classes/controllers/FrmFieldsController.php +4 -4
  3. classes/controllers/FrmFormActionsController.php +1 -1
  4. classes/controllers/FrmFormsController.php +6 -4
  5. classes/controllers/FrmHooksController.php +1 -3
  6. classes/controllers/FrmStylesController.php +0 -1
  7. classes/helpers/FrmAppHelper.php +16 -2
  8. classes/helpers/FrmEntriesHelper.php +1 -0
  9. classes/helpers/FrmXMLHelper.php +4 -0
  10. classes/models/FrmDb.php +3 -3
  11. classes/models/FrmEntry.php +14 -3
  12. classes/models/FrmEntryFormat.php +5 -0
  13. classes/models/FrmEntryValidate.php +2 -2
  14. classes/models/FrmForm.php +6 -0
  15. classes/models/FrmFormAction.php +4 -2
  16. classes/models/FrmNotification.php +10 -1
  17. classes/models/FrmStyle.php +9 -0
  18. classes/views/frm-entries/form.php +11 -3
  19. classes/views/frm-entries/new.php +16 -9
  20. classes/views/frm-form-actions/_action_inside.php +5 -6
  21. classes/views/frm-form-actions/default_actions.php +7 -7
  22. classes/views/frm-form-actions/email_action.php +1 -1
  23. classes/views/frm-forms/add_field_links.php +1 -0
  24. classes/views/styles/_buttons.php +3 -2
  25. classes/views/styles/_check-box-radio-fields.php +3 -2
  26. classes/views/styles/_field-description.php +3 -2
  27. classes/views/styles/_field-labels.php +6 -4
  28. classes/views/styles/_sample_form.php +2 -1
  29. classes/views/styles/_section-fields.php +3 -2
  30. classes/widgets/FrmShowForm.php +1 -1
  31. css/_single_theme.css.php +1 -1
  32. css/custom_theme.css.php +36 -4
  33. css/frm_admin.css +2 -16
  34. formidable.php +1 -1
  35. js/formidable.js +158 -50
  36. js/formidable.min.js +56 -55
  37. js/formidable_admin.js +25 -4
  38. readme.txt +38 -2
classes/controllers/FrmEntriesController.php CHANGED
@@ -451,7 +451,7 @@ class FrmEntriesController {
451
  $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
452
 
453
  if ( empty( $errors ) ) {
454
- $_POST['frm_skip_cookie'] = 1;
455
  if ( $params['action'] == 'create' ) {
456
  if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
457
  $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
@@ -459,7 +459,7 @@ class FrmEntriesController {
459
  }
460
 
461
  do_action( 'frm_process_entry', $params, $errors, $form, array( 'ajax' => $ajax ) );
462
- unset( $_POST['frm_skip_cookie'] );
463
  }
464
  }
465
 
451
  $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
452
 
453
  if ( empty( $errors ) ) {
454
+ $_POST['frm_skip_cookie'] = 1;
455
  if ( $params['action'] == 'create' ) {
456
  if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
457
  $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
459
  }
460
 
461
  do_action( 'frm_process_entry', $params, $errors, $form, array( 'ajax' => $ajax ) );
462
+ unset( $_POST['frm_skip_cookie'] );
463
  }
464
  }
465
 
classes/controllers/FrmFieldsController.php CHANGED
@@ -553,6 +553,10 @@ class FrmFieldsController {
553
  }
554
 
555
  private static function add_input_classes($field, array &$class) {
 
 
 
 
556
  if ( $field['type'] == 'hidden' || $field['type'] == 'user_id' ) {
557
  return;
558
  }
@@ -565,10 +569,6 @@ class FrmFieldsController {
565
  if ( isset($field['size']) && $field['size'] > 0 ) {
566
  $class[] = 'auto_width';
567
  }
568
-
569
- if ( isset($field['input_class']) && ! empty($field['input_class']) ) {
570
- $class[] = $field['input_class'];
571
- }
572
  }
573
 
574
  private static function add_html_size($field, array &$add_html) {
553
  }
554
 
555
  private static function add_input_classes($field, array &$class) {
556
+ if ( isset($field['input_class']) && ! empty($field['input_class']) ) {
557
+ $class[] = $field['input_class'];
558
+ }
559
+
560
  if ( $field['type'] == 'hidden' || $field['type'] == 'user_id' ) {
561
  return;
562
  }
569
  if ( isset($field['size']) && $field['size'] > 0 ) {
570
  $class[] = 'auto_width';
571
  }
 
 
 
 
572
  }
573
 
574
  private static function add_html_size($field, array &$add_html) {
classes/controllers/FrmFormActionsController.php CHANGED
@@ -241,7 +241,7 @@ class FrmFormActionsController {
241
  public static function trigger_actions( $event, $form, $entry, $type = 'all', $args = array() ) {
242
  $form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type );
243
 
244
- if ( empty( $form_actions ) ) {
245
  return;
246
  }
247
 
241
  public static function trigger_actions( $event, $form, $entry, $type = 'all', $args = array() ) {
242
  $form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type );
243
 
244
+ if ( empty( $form_actions ) || ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) ) {
245
  return;
246
  }
247
 
classes/controllers/FrmFormsController.php CHANGED
@@ -931,14 +931,15 @@ class FrmFormsController {
931
 
932
  /* FRONT-END FORMS */
933
  public static function admin_bar_css() {
934
- FrmAppHelper::load_font_style();
935
- }
936
-
937
- public static function admin_bar_configure() {
938
  if ( is_admin() || ! current_user_can( 'frm_edit_forms' ) ) {
939
  return;
940
  }
941
 
 
 
 
 
 
942
  global $frm_vars;
943
  if ( empty($frm_vars['forms_loaded']) ) {
944
  return;
@@ -1104,6 +1105,7 @@ class FrmFormsController {
1104
  $errors = isset( $frm_vars['created_entries'][ $form->id ] ) ? $frm_vars['created_entries'][ $form->id ]['errors'] : array();
1105
  }
1106
 
 
1107
  $fields = FrmFieldsHelper::get_form_fields( $form->id, ( isset( $errors ) && ! empty( $errors ) ) );
1108
 
1109
  if ( $params['action'] != 'create' || $params['posted_form_id'] != $form->id || ! $_POST ) {
931
 
932
  /* FRONT-END FORMS */
933
  public static function admin_bar_css() {
 
 
 
 
934
  if ( is_admin() || ! current_user_can( 'frm_edit_forms' ) ) {
935
  return;
936
  }
937
 
938
+ add_action( 'wp_before_admin_bar_render', 'FrmFormsController::admin_bar_configure' );
939
+ FrmAppHelper::load_font_style();
940
+ }
941
+
942
+ public static function admin_bar_configure() {
943
  global $frm_vars;
944
  if ( empty($frm_vars['forms_loaded']) ) {
945
  return;
1105
  $errors = isset( $frm_vars['created_entries'][ $form->id ] ) ? $frm_vars['created_entries'][ $form->id ]['errors'] : array();
1106
  }
1107
 
1108
+ $include_form_tag = apply_filters( 'frm_include_form_tag', true, $form );
1109
  $fields = FrmFieldsHelper::get_form_fields( $form->id, ( isset( $errors ) && ! empty( $errors ) ) );
1110
 
1111
  if ( $params['action'] != 'create' || $params['posted_form_id'] != $form->id || ! $_POST ) {
classes/controllers/FrmHooksController.php CHANGED
@@ -52,8 +52,7 @@ class FrmHooksController {
52
  add_filter( 'widget_text', 'FrmAppController::widget_text_filter', 8 );
53
 
54
  // Entries controller
55
- add_action( 'wp', 'FrmEntriesController::process_entry', 10, 0 );
56
- add_action( 'frm_wp', 'FrmEntriesController::process_entry', 10, 0 );
57
  add_filter( 'frm_redirect_url', 'FrmEntriesController::delete_entry_before_redirect', 50, 3 );
58
  add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 );
59
  add_filter( 'frm_email_value', 'FrmEntriesController::filter_email_value', 10, 3 );
@@ -69,7 +68,6 @@ class FrmHooksController {
69
  add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
70
  add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
71
  add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
72
- add_action( 'wp_before_admin_bar_render', 'FrmFormsController::admin_bar_configure' );
73
  add_action( 'wp_footer', 'FrmFormsController::footer_js', 1, 0 );
74
 
75
  add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' );
52
  add_filter( 'widget_text', 'FrmAppController::widget_text_filter', 8 );
53
 
54
  // Entries controller
55
+ add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 );
 
56
  add_filter( 'frm_redirect_url', 'FrmEntriesController::delete_entry_before_redirect', 50, 3 );
57
  add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 );
58
  add_filter( 'frm_email_value', 'FrmEntriesController::filter_email_value', 10, 3 );
68
  add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
69
  add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
70
  add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
 
71
  add_action( 'wp_footer', 'FrmFormsController::footer_js', 1, 0 );
72
 
73
  add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' );
classes/controllers/FrmStylesController.php CHANGED
@@ -55,7 +55,6 @@ class FrmStylesController {
55
  $version = FrmAppHelper::plugin_version();
56
  wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version );
57
 
58
- wp_enqueue_style('jquery-ui-base', FrmAppHelper::jquery_ui_base_url() .'/themes/base/ui.all.css');
59
  wp_enqueue_style('frm-custom-theme', admin_url('admin-ajax.php') .'?action=frmpro_css');
60
 
61
  $style = apply_filters('frm_style_head', false);
55
  $version = FrmAppHelper::plugin_version();
56
  wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version );
57
 
 
58
  wp_enqueue_style('frm-custom-theme', admin_url('admin-ajax.php') .'?action=frmpro_css');
59
 
60
  $style = apply_filters('frm_style_head', false);
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.0.10';
14
 
15
  /**
16
  * @since 1.07.02
@@ -760,12 +760,21 @@ class FrmAppHelper {
760
 
761
  public static function recursive_function_map( $value, $function ) {
762
  if ( is_array( $value ) ) {
 
763
  if ( count( $value ) ) {
764
  $function = explode( ', ', self::prepare_array_values( $value, $function ) );
765
  } else {
766
  $function = array( $function );
767
  }
768
- $value = array_map( array( 'FrmAppHelper', 'recursive_function_map' ), $value, $function );
 
 
 
 
 
 
 
 
769
  } else {
770
  $value = call_user_func( $function, $value );
771
  }
@@ -773,6 +782,10 @@ class FrmAppHelper {
773
  return $value;
774
  }
775
 
 
 
 
 
776
  /**
777
  * Flatten a multi-dimensional array
778
  */
@@ -1741,6 +1754,7 @@ class FrmAppHelper {
1741
  'import_complete' => __( 'Import Complete', 'formidable' ),
1742
  'updating' => __( 'Please wait while your site updates.', 'formidable' ),
1743
  'no_save_warning' => __( 'Warning: There is no way to retrieve unsaved entries.', 'formidable' ),
 
1744
  'jquery_ui_url' => self::jquery_ui_base_url(),
1745
  ) );
1746
  }
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.0.11';
14
 
15
  /**
16
  * @since 1.07.02
760
 
761
  public static function recursive_function_map( $value, $function ) {
762
  if ( is_array( $value ) ) {
763
+ $original_function = $function;
764
  if ( count( $value ) ) {
765
  $function = explode( ', ', self::prepare_array_values( $value, $function ) );
766
  } else {
767
  $function = array( $function );
768
  }
769
+ if ( ! self::is_assoc( $value ) ) {
770
+ $value = array_map( array( 'FrmAppHelper', 'recursive_function_map' ), $value, $function );
771
+ } else {
772
+ foreach ( $value as $k => $v ) {
773
+ if ( ! is_array( $v ) ) {
774
+ $value[ $k ] = call_user_func( $original_function, $v );
775
+ }
776
+ }
777
+ }
778
  } else {
779
  $value = call_user_func( $function, $value );
780
  }
782
  return $value;
783
  }
784
 
785
+ public static function is_assoc( $array ) {
786
+ return (bool) count( array_filter( array_keys( $array ), 'is_string' ) );
787
+ }
788
+
789
  /**
790
  * Flatten a multi-dimensional array
791
  */
1754
  'import_complete' => __( 'Import Complete', 'formidable' ),
1755
  'updating' => __( 'Please wait while your site updates.', 'formidable' ),
1756
  'no_save_warning' => __( 'Warning: There is no way to retrieve unsaved entries.', 'formidable' ),
1757
+ 'private' => __( 'Private' ),
1758
  'jquery_ui_url' => self::jquery_ui_base_url(),
1759
  ) );
1760
  }
classes/helpers/FrmEntriesHelper.php CHANGED
@@ -435,6 +435,7 @@ class FrmEntriesHelper {
435
  }
436
 
437
  if ( is_array($val) ) {
 
438
  $val = implode(',', $val);
439
  }
440
 
435
  }
436
 
437
  if ( is_array($val) ) {
438
+ $val = FrmAppHelper::array_flatten( $val );
439
  $val = implode(',', $val);
440
  }
441
 
classes/helpers/FrmXMLHelper.php CHANGED
@@ -52,6 +52,10 @@ class FrmXMLHelper {
52
  return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this XML file', 'formidable' ), libxml_get_errors() );
53
  }
54
 
 
 
 
 
55
  $xml = simplexml_import_dom( $dom );
56
  unset( $dom );
57
 
52
  return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this XML file', 'formidable' ), libxml_get_errors() );
53
  }
54
 
55
+ if ( ! function_exists('simplexml_import_dom') ) {
56
+ return new WP_Error( 'SimpleXML_parse_error', __( 'Your server in missing the simplexml_import_dom function', 'formidable' ), libxml_get_errors() );
57
+ }
58
+
59
  $xml = simplexml_import_dom( $dom );
60
  unset( $dom );
61
 
classes/models/FrmDb.php CHANGED
@@ -36,11 +36,11 @@ class FrmDb {
36
  $this->create_tables();
37
  $this->migrate_data($frm_db_version, $old_db_version);
38
 
39
- /**** ADD/UPDATE DEFAULT TEMPLATES ****/
40
- FrmXMLController::add_default_templates();
41
-
42
  /***** SAVE DB VERSION *****/
43
  update_option('frm_db_version', $frm_db_version);
 
 
 
44
  }
45
 
46
  do_action('frm_after_install');
36
  $this->create_tables();
37
  $this->migrate_data($frm_db_version, $old_db_version);
38
 
 
 
 
39
  /***** SAVE DB VERSION *****/
40
  update_option('frm_db_version', $frm_db_version);
41
+
42
+ /**** ADD/UPDATE DEFAULT TEMPLATES ****/
43
+ FrmXMLController::add_default_templates();
44
  }
45
 
46
  do_action('frm_after_install');
classes/models/FrmEntry.php CHANGED
@@ -16,9 +16,10 @@ class FrmEntry {
16
  $values['item_key'] = '';
17
  }
18
 
 
19
  $new_values = array(
20
  'item_key' => FrmAppHelper::get_unique_key($values['item_key'], $wpdb->prefix .'frm_items', 'item_key'),
21
- 'name' => FrmAppHelper::truncate( ( isset( $values['name'] ) ? $values['name'] : $values['item_key'] ), 255, 1, '' ),
22
  'ip' => FrmAppHelper::get_ip_address(),
23
  'is_draft' => ( ( isset($values['frm_saving_draft']) && $values['frm_saving_draft'] == 1 ) || ( isset($values['is_draft']) && $values['is_draft'] == 1) ) ? 1 : 0,
24
  'form_id' => isset($values['form_id']) ? (int) $values['form_id']: null,
@@ -194,8 +195,9 @@ class FrmEntry {
194
 
195
  $user_ID = get_current_user_id();
196
 
 
197
  $new_values = array(
198
- 'name' => isset($values['name']) ? $values['name'] : '',
199
  'form_id' => isset($values['form_id']) ? (int) $values['form_id'] : null,
200
  'is_draft' => ( ( isset($values['frm_saving_draft']) && $values['frm_saving_draft'] == 1 ) || ( isset($values['is_draft']) && $values['is_draft'] == 1) ) ? 1 : 0,
201
  'updated_at' => current_time('mysql', 1),
@@ -282,6 +284,15 @@ class FrmEntry {
282
  FrmAppHelper::cache_delete_group( 'frm_item_meta' );
283
  }
284
 
 
 
 
 
 
 
 
 
 
285
  /**
286
  * If $entry is numeric, get the entry object
287
  * @param int|object $entry by reference
@@ -502,7 +513,7 @@ class FrmEntry {
502
  'frm_action' => 'sanitize_title',
503
  'form_key' => 'sanitize_title',
504
  'item_key' => 'sanitize_title',
505
- 'name' => 'sanitize_text_field',
506
  'frm_saving_draft' => 'absint',
507
  'is_draft' => 'absint',
508
  'post_id' => 'absint',
16
  $values['item_key'] = '';
17
  }
18
 
19
+ $item_name = self::get_new_entry_name( $values, $values['item_key'] );
20
  $new_values = array(
21
  'item_key' => FrmAppHelper::get_unique_key($values['item_key'], $wpdb->prefix .'frm_items', 'item_key'),
22
+ 'name' => FrmAppHelper::truncate( $item_name, 255, 1, '' ),
23
  'ip' => FrmAppHelper::get_ip_address(),
24
  'is_draft' => ( ( isset($values['frm_saving_draft']) && $values['frm_saving_draft'] == 1 ) || ( isset($values['is_draft']) && $values['is_draft'] == 1) ) ? 1 : 0,
25
  'form_id' => isset($values['form_id']) ? (int) $values['form_id']: null,
195
 
196
  $user_ID = get_current_user_id();
197
 
198
+ $item_name = self::get_new_entry_name( $values );
199
  $new_values = array(
200
+ 'name' => $item_name,
201
  'form_id' => isset($values['form_id']) ? (int) $values['form_id'] : null,
202
  'is_draft' => ( ( isset($values['frm_saving_draft']) && $values['frm_saving_draft'] == 1 ) || ( isset($values['is_draft']) && $values['is_draft'] == 1) ) ? 1 : 0,
203
  'updated_at' => current_time('mysql', 1),
284
  FrmAppHelper::cache_delete_group( 'frm_item_meta' );
285
  }
286
 
287
+ /**
288
+ * After switching to the wp_loaded hook for processing entries,
289
+ * we can no longer use 'name', but check it as a fallback
290
+ * @since 2.0.11
291
+ */
292
+ public static function get_new_entry_name( $values, $default = '' ) {
293
+ return isset( $values['item_name'] ) ? $values['item_name'] : ( isset( $values['name'] ) ? $values['name'] : $default );
294
+ }
295
+
296
  /**
297
  * If $entry is numeric, get the entry object
298
  * @param int|object $entry by reference
513
  'frm_action' => 'sanitize_title',
514
  'form_key' => 'sanitize_title',
515
  'item_key' => 'sanitize_title',
516
+ 'item_name' => 'sanitize_text_field',
517
  'frm_saving_draft' => 'absint',
518
  'is_draft' => 'absint',
519
  'post_id' => 'absint',
classes/models/FrmEntryFormat.php CHANGED
@@ -9,6 +9,7 @@ class FrmEntryFormat {
9
  'font_size' => '', 'text_color' => '',
10
  'border_width' => '', 'border_color' => '',
11
  'bg_color' => '', 'alt_bg_color' => '',
 
12
  ), $atts );
13
 
14
  if ( $atts['format'] != 'text' ) {
@@ -61,6 +62,10 @@ class FrmEntryFormat {
61
  $content = implode('', $content);
62
  }
63
 
 
 
 
 
64
  return $content;
65
  }
66
 
9
  'font_size' => '', 'text_color' => '',
10
  'border_width' => '', 'border_color' => '',
11
  'bg_color' => '', 'alt_bg_color' => '',
12
+ 'clickable' => false,
13
  ), $atts );
14
 
15
  if ( $atts['format'] != 'text' ) {
62
  $content = implode('', $content);
63
  }
64
 
65
+ if ( $atts['clickable'] ) {
66
+ $content = make_clickable( $content );
67
+ }
68
+
69
  return $content;
70
  }
71
 
classes/models/FrmEntryValidate.php CHANGED
@@ -78,8 +78,8 @@ class FrmEntryValidate {
78
  if ( $posted_field->required == '1' && ! is_array( $value ) && trim( $value ) == '' ) {
79
  $frm_settings = FrmAppHelper::get_settings();
80
  $errors[ 'field' . $args['id'] ] = ( ! isset( $posted_field->field_options['blank'] ) || $posted_field->field_options['blank'] == '' ) ? $frm_settings->blank_msg : $posted_field->field_options['blank'];
81
- } else if ( $posted_field->type == 'text' && ! isset( $_POST['name'] ) ) {
82
- $_POST['name'] = $value;
83
  }
84
 
85
  self::validate_url_field($errors, $posted_field, $value, $args);
78
  if ( $posted_field->required == '1' && ! is_array( $value ) && trim( $value ) == '' ) {
79
  $frm_settings = FrmAppHelper::get_settings();
80
  $errors[ 'field' . $args['id'] ] = ( ! isset( $posted_field->field_options['blank'] ) || $posted_field->field_options['blank'] == '' ) ? $frm_settings->blank_msg : $posted_field->field_options['blank'];
81
+ } else if ( $posted_field->type == 'text' && ! isset( $_POST['item_name'] ) ) {
82
+ $_POST['item_name'] = $value;
83
  }
84
 
85
  self::validate_url_field($errors, $posted_field, $value, $args);
classes/models/FrmForm.php CHANGED
@@ -728,4 +728,10 @@ class FrmForm {
728
 
729
  return ( ( ! isset($frm_vars['css_loaded']) || ! $frm_vars['css_loaded'] ) && $global_load );
730
  }
 
 
 
 
 
 
731
  }
728
 
729
  return ( ( ! isset($frm_vars['css_loaded']) || ! $frm_vars['css_loaded'] ) && $global_load );
730
  }
731
+
732
+ public static function show_submit( $form ) {
733
+ $show = ( ! $form->is_template && $form->status == 'published' && ! FrmAppHelper::is_admin() );
734
+ $show = apply_filters( 'frm_show_submit_button', $show, $form );
735
+ return $show;
736
+ }
737
  }
classes/models/FrmFormAction.php CHANGED
@@ -339,8 +339,10 @@ class FrmFormAction {
339
 
340
  public function get_single_action( $id ) {
341
  $action = get_post($id);
342
- $action = $this->prepare_action($action);
343
- $this->_set($id);
 
 
344
  return $action;
345
  }
346
 
339
 
340
  public function get_single_action( $id ) {
341
  $action = get_post($id);
342
+ if ( $action ) {
343
+ $action = $this->prepare_action( $action );
344
+ $this->_set( $id );
345
+ }
346
  return $action;
347
  }
348
 
classes/models/FrmNotification.php CHANGED
@@ -218,7 +218,7 @@ class FrmNotification {
218
 
219
  // If reply-to isn't set, make it match the from settings
220
  if ( empty( $atts['reply_to'] ) ) {
221
- $atts['reply_to'] = $atts['from'];
222
  }
223
 
224
  if ( ! is_array($atts['to_email']) && '[admin_email]' == $atts['to_email'] ) {
@@ -226,6 +226,14 @@ class FrmNotification {
226
  }
227
  }
228
 
 
 
 
 
 
 
 
 
229
  /**
230
  * Format individual email fields
231
  *
@@ -349,6 +357,7 @@ class FrmNotification {
349
  // remove line breaks in HTML emails to prevent conflicts with Mandrill
350
  add_filter( 'mandrill_nl2br', 'FrmNotification::remove_mandrill_br' );
351
  }
 
352
 
353
  $header = apply_filters('frm_email_header', $header, array(
354
  'to_email' => $atts['to_email'], 'subject' => $atts['subject'],
218
 
219
  // If reply-to isn't set, make it match the from settings
220
  if ( empty( $atts['reply_to'] ) ) {
221
+ $atts['reply_to'] = self::get_email_from_formatted_string( $atts['from'] );
222
  }
223
 
224
  if ( ! is_array($atts['to_email']) && '[admin_email]' == $atts['to_email'] ) {
226
  }
227
  }
228
 
229
+ private static function get_email_from_formatted_string( $value ) {
230
+ if ( strpos( $value, '<' ) !== false ) {
231
+ preg_match_all( '/\<([^)]+)\>/', $value, $emails );
232
+ $value = $emails[1][0];
233
+ }
234
+ return $value;
235
+ }
236
+
237
  /**
238
  * Format individual email fields
239
  *
357
  // remove line breaks in HTML emails to prevent conflicts with Mandrill
358
  add_filter( 'mandrill_nl2br', 'FrmNotification::remove_mandrill_br' );
359
  }
360
+ $message = apply_filters( 'frm_email_message', $message, $atts );
361
 
362
  $header = apply_filters('frm_email_header', $header, array(
363
  'to_email' => $atts['to_email'], 'subject' => $atts['subject'],
classes/models/FrmStyle.php CHANGED
@@ -425,4 +425,13 @@ class FrmStyle {
425
  return 'frm_style_setting'. ( empty($post_field) ? '' : '['. $post_field .']' ) .'[' . $field_name . ']';
426
  }
427
 
 
 
 
 
 
 
 
 
 
428
  }
425
  return 'frm_style_setting'. ( empty($post_field) ? '' : '['. $post_field .']' ) .'[' . $field_name . ']';
426
  }
427
 
428
+ public static function get_bold_options() {
429
+ return array(
430
+ 100 => 100, 200 => 200, 300 => 300,
431
+ 'normal' => __( 'normal', 'formidable' ),
432
+ 500 => 500, 600 => 600,
433
+ 'bold' => __( 'bold', 'formidable' ),
434
+ 800 => 800, 900 => 900,
435
+ );
436
+ }
437
  }
classes/views/frm-entries/form.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  global $frm_vars;
3
  FrmFormsController::maybe_load_css( $form, $values['custom_style'], $frm_vars['load_css'] );
4
  ?>
@@ -20,8 +29,7 @@ if ( $values['fields'] ) {
20
  } else {
21
  do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) );
22
  }
23
-
24
- do_action('frm_get_field_scripts', $field, $form);
25
  }
26
  }
27
 
@@ -59,7 +67,7 @@ if ( has_action('frm_entries_footer_scripts') ) { ?>
59
  </script><?php
60
  }
61
 
62
- if ( ! $form->is_template && $form->status == 'published' && ! FrmAppHelper::is_admin() ) {
63
  unset($values['fields']);
64
  FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values);
65
  }
1
  <?php
2
+ if ( empty($values) || ! isset($values['fields']) || empty($values['fields']) ) { ?>
3
+ <div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($form); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
4
+ <div class="frm_error_style"><strong><?php _e( 'Oops!', 'formidable' ) ?></strong> <?php printf( __( 'You did not add any fields to your form. %1$sGo back%2$s and add some.', 'formidable' ), '<a href="' . esc_url( admin_url( '?page=formidable&frm_action=edit&id=' . $form->id ) ) . '">', '</a>' ) ?>
5
+ </div>
6
+ </div>
7
+ <?php
8
+ return;
9
+ }
10
+
11
  global $frm_vars;
12
  FrmFormsController::maybe_load_css( $form, $values['custom_style'], $frm_vars['load_css'] );
13
  ?>
29
  } else {
30
  do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) );
31
  }
32
+ do_action('frm_get_field_scripts', $field, $form, $form->id);
 
33
  }
34
  }
35
 
67
  </script><?php
68
  }
69
 
70
+ if ( FrmForm::show_submit( $form ) ) {
71
  unset($values['fields']);
72
  FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values);
73
  }
classes/views/frm-entries/new.php CHANGED
@@ -1,18 +1,25 @@
1
- <?php
2
- if ( empty($values) || ! isset($values['fields']) || empty($values['fields']) ) { ?>
3
- <div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($form); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
4
- <div class="frm_error_style"><strong><?php _e( 'Oops!', 'formidable' ) ?></strong> <?php printf( __( 'You did not add any fields to your form. %1$sGo back%2$s and add some.', 'formidable' ), '<a href="' . esc_url( admin_url( '?page=formidable&frm_action=edit&id=' . $form->id ) ) . '">', '</a>' ) ?>
5
- </div>
6
- </div>
7
- <?php
8
- return;
9
- } ?>
10
  <div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($values); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
 
 
 
11
  <form enctype="<?php echo esc_attr( apply_filters( 'frm_form_enctype', 'multipart/form-data', $form ) ) ?>" method="post" class="frm-show-form <?php do_action('frm_form_classes', $form) ?>" id="form_<?php echo esc_attr( $form->form_key ) ?>" <?php echo $frm_settings->use_html ? '' : 'action=""'; ?>>
12
  <?php
 
 
 
 
 
13
  include(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/errors.php');
14
  $form_action = 'create';
15
  require(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/form.php');
 
 
16
  ?>
17
  </form>
 
 
 
 
 
 
18
  </div>
 
 
 
 
 
 
 
 
 
1
  <div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($values); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container">
2
+ <?php
3
+ if ( ! isset( $include_form_tag ) || $include_form_tag ) {
4
+ ?>
5
  <form enctype="<?php echo esc_attr( apply_filters( 'frm_form_enctype', 'multipart/form-data', $form ) ) ?>" method="post" class="frm-show-form <?php do_action('frm_form_classes', $form) ?>" id="form_<?php echo esc_attr( $form->form_key ) ?>" <?php echo $frm_settings->use_html ? '' : 'action=""'; ?>>
6
  <?php
7
+ } else { ?>
8
+ <div id="form_<?php echo esc_attr( $form->form_key ) ?>" class="frm-show-form <?php do_action('frm_form_classes', $form) ?>" >
9
+ <?php
10
+ }
11
+
12
  include(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/errors.php');
13
  $form_action = 'create';
14
  require(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/form.php');
15
+
16
+ if ( ! isset( $include_form_tag ) || $include_form_tag ) {
17
  ?>
18
  </form>
19
+ <?php
20
+ } else { ?>
21
+ </div>
22
+ <?php
23
+ }
24
+ ?>
25
  </div>
classes/views/frm-form-actions/_action_inside.php CHANGED
@@ -30,7 +30,8 @@ if ( count( $action_control->action_options['event'] ) == 1 || $action_control->
30
  }
31
  } else {
32
  ?>
33
- <p><label><?php _e( 'Trigger this action after', 'formidable' ) ?></label>
 
34
  <?php
35
  $event_labels = apply_filters( 'frm_action_triggers', array(
36
  'create' => __( 'Create', 'formidable' ),
@@ -39,13 +40,11 @@ if ( count( $action_control->action_options['event'] ) == 1 || $action_control->
39
  ) );
40
 
41
  foreach ( $action_control->action_options['event'] as $event ) { ?>
42
- <label for="frm_action_event_<?php echo esc_attr( $event ) ?>" class="frm_action_events">
43
- <input type="checkbox" name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" value="<?php echo esc_attr( $event ) ?>" id="<?php echo esc_attr( $action_control->get_field_id('frm_action_event_'. $event) ) ?>" <?php FrmAppHelper::checked($form_action->post_content['event'], $event) ?> />
44
- <?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?>
45
- </label>
46
  <?php
47
  }
48
- ?> </p>
 
49
  <?php
50
  }
51
 
30
  }
31
  } else {
32
  ?>
33
+ <p><label class="frm_left_label"><?php _e( 'Trigger this action after', 'formidable' ) ?></label>
34
+ <select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>">
35
  <?php
36
  $event_labels = apply_filters( 'frm_action_triggers', array(
37
  'create' => __( 'Create', 'formidable' ),
40
  ) );
41
 
42
  foreach ( $action_control->action_options['event'] as $event ) { ?>
43
+ <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option>
 
 
 
44
  <?php
45
  }
46
+ ?> </select>
47
+ </p>
48
  <?php
49
  }
50
 
classes/views/frm-form-actions/default_actions.php CHANGED
@@ -5,7 +5,7 @@ class FrmDefPostAction extends FrmFormAction {
5
  $action_ops = FrmFormAction::default_action_opts();
6
  $action_ops['classes'] = 'ab-icon frm_dashicon_font dashicons-before';
7
 
8
- $this->FrmFormAction('wppost', __( 'Create Post', 'formidable' ), $action_ops);
9
  }
10
  }
11
 
@@ -13,7 +13,7 @@ class FrmDefPostAction extends FrmFormAction {
13
  class FrmDefRegAction extends FrmFormAction {
14
  public function __construct() {
15
  $action_ops = FrmFormAction::default_action_opts('frm_register_icon');
16
- $this->FrmFormAction('register', __( 'Register User', 'formidable' ), $action_ops);
17
  }
18
  }
19
 
@@ -21,7 +21,7 @@ class FrmDefRegAction extends FrmFormAction {
21
  class FrmDefPayPalAction extends FrmFormAction {
22
  public function __construct() {
23
  $action_ops = FrmFormAction::default_action_opts('frm_paypal_icon');
24
- $this->FrmFormAction('paypal', __( 'Collect Payment', 'formidable' ), $action_ops);
25
  }
26
  }
27
 
@@ -29,7 +29,7 @@ class FrmDefPayPalAction extends FrmFormAction {
29
  class FrmDefAweberAction extends FrmFormAction {
30
  public function __construct() {
31
  $action_ops = FrmFormAction::default_action_opts('frm_aweber_icon');
32
- $this->FrmFormAction('aweber', __( 'Aweber', 'formidable' ), $action_ops);
33
  }
34
  }
35
 
@@ -37,7 +37,7 @@ class FrmDefAweberAction extends FrmFormAction {
37
  class FrmDefMlcmpAction extends FrmFormAction {
38
  public function __construct() {
39
  $action_ops = FrmFormAction::default_action_opts('frm_mailchimp_icon');
40
- $this->FrmFormAction('mailchimp', __( 'MailChimp', 'formidable' ), $action_ops);
41
  }
42
  }
43
 
@@ -45,7 +45,7 @@ class FrmDefMlcmpAction extends FrmFormAction {
45
  class FrmDefTwilioAction extends FrmFormAction {
46
  public function __construct() {
47
  $action_ops = FrmFormAction::default_action_opts('frm_sms_icon');
48
- $this->FrmFormAction('twilio', __( 'Twilio', 'formidable' ), $action_ops);
49
  }
50
  }
51
 
@@ -53,6 +53,6 @@ class FrmDefTwilioAction extends FrmFormAction {
53
  class FrmDefHrsAction extends FrmFormAction {
54
  public function __construct() {
55
  $action_ops = FrmFormAction::default_action_opts('frm_highrise_icon');
56
- $this->FrmFormAction('highrise', __( 'Highrise', 'formidable' ), $action_ops);
57
  }
58
  }
5
  $action_ops = FrmFormAction::default_action_opts();
6
  $action_ops['classes'] = 'ab-icon frm_dashicon_font dashicons-before';
7
 
8
+ parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops );
9
  }
10
  }
11
 
13
  class FrmDefRegAction extends FrmFormAction {
14
  public function __construct() {
15
  $action_ops = FrmFormAction::default_action_opts('frm_register_icon');
16
+ parent::__construct( 'register', __( 'Register User', 'formidable' ), $action_ops );
17
  }
18
  }
19
 
21
  class FrmDefPayPalAction extends FrmFormAction {
22
  public function __construct() {
23
  $action_ops = FrmFormAction::default_action_opts('frm_paypal_icon');
24
+ parent::__construct( 'paypal', __( 'Collect Payment', 'formidable' ), $action_ops );
25
  }
26
  }
27
 
29
  class FrmDefAweberAction extends FrmFormAction {
30
  public function __construct() {
31
  $action_ops = FrmFormAction::default_action_opts('frm_aweber_icon');
32
+ parent::__construct( 'aweber', __( 'Aweber', 'formidable' ), $action_ops );
33
  }
34
  }
35
 
37
  class FrmDefMlcmpAction extends FrmFormAction {
38
  public function __construct() {
39
  $action_ops = FrmFormAction::default_action_opts('frm_mailchimp_icon');
40
+ parent::__construct( 'mailchimp', __( 'MailChimp', 'formidable' ), $action_ops );
41
  }
42
  }
43
 
45
  class FrmDefTwilioAction extends FrmFormAction {
46
  public function __construct() {
47
  $action_ops = FrmFormAction::default_action_opts('frm_sms_icon');
48
+ parent::__construct( 'twilio', __( 'Twilio', 'formidable' ), $action_ops );
49
  }
50
  }
51
 
53
  class FrmDefHrsAction extends FrmFormAction {
54
  public function __construct() {
55
  $action_ops = FrmFormAction::default_action_opts('frm_highrise_icon');
56
+ parent::__construct( 'highrise', __( 'Highrise', 'formidable' ), $action_ops );
57
  }
58
  }
classes/views/frm-form-actions/email_action.php CHANGED
@@ -13,7 +13,7 @@ class FrmEmailAction extends FrmFormAction {
13
  );
14
  $action_ops = apply_filters('frm_email_control_settings', $action_ops);
15
 
16
- $this->FrmFormAction('email', __( 'Email Notification', 'formidable' ), $action_ops);
17
  }
18
 
19
  public function form( $form_action, $args = array() ) {
13
  );
14
  $action_ops = apply_filters('frm_email_control_settings', $action_ops);
15
 
16
+ parent::__construct('email', __( 'Email Notification', 'formidable' ), $action_ops);
17
  }
18
 
19
  public function form( $form_action, $args = array() ) {
classes/views/frm-forms/add_field_links.php CHANGED
@@ -115,6 +115,7 @@ foreach ( FrmField::pro_field_selection() as $field_key => $field_type ) {
115
  'frm_total' => array( 'label' => __( 'Total', 'formidable' ), 'title' => __( 'Add this to a read-only field to display the text in bold without a border or background.', 'formidable' ) ),
116
  'frm_scroll_box' => array( 'label' => __( 'Scroll Box', 'formidable' ), 'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options.', 'formidable' ) ),
117
  'frm_text_block' => array( 'label' => __( 'Align Option Text', 'formidable' ), 'title' => __( 'If you have a large amount of text in a checkbox or radio button field, use this class to align all the text in a block.', 'formidable' ) ),
 
118
  );
119
 
120
  $classes = apply_filters( 'frm_layout_classes', $classes );
115
  'frm_total' => array( 'label' => __( 'Total', 'formidable' ), 'title' => __( 'Add this to a read-only field to display the text in bold without a border or background.', 'formidable' ) ),
116
  'frm_scroll_box' => array( 'label' => __( 'Scroll Box', 'formidable' ), 'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options.', 'formidable' ) ),
117
  'frm_text_block' => array( 'label' => __( 'Align Option Text', 'formidable' ), 'title' => __( 'If you have a large amount of text in a checkbox or radio button field, use this class to align all the text in a block.', 'formidable' ) ),
118
+ 'frm_capitalize' => array( 'label' => __( 'Capitalize', 'formidable' ), 'title' => __( 'Automatically capitalize the first letter in each word.', 'formidable' ) ),
119
  );
120
 
121
  $classes = apply_filters( 'frm_layout_classes', $classes );
classes/views/styles/_buttons.php CHANGED
@@ -36,8 +36,9 @@
36
  <div class="field-group clearfix">
37
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
38
  <select name="<?php echo esc_attr( $frm_style->get_field_name('submit_weight') ) ?>" id="frm_submit_weight">
39
- <option value="normal" <?php selected($style->post_content['submit_weight'], 'normal') ?>><?php _e( 'normal', 'formidable' ) ?></option>
40
- <option value="bold" <?php selected($style->post_content['submit_weight'], 'bold') ?>><?php _e( 'bold', 'formidable' ) ?></option>
 
41
  </select>
42
  </div>
43
 
36
  <div class="field-group clearfix">
37
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
38
  <select name="<?php echo esc_attr( $frm_style->get_field_name('submit_weight') ) ?>" id="frm_submit_weight">
39
+ <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
40
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['submit_weight'], $value ) ?>><?php echo $name ?></option>
41
+ <?php } ?>
42
  </select>
43
  </div>
44
 
classes/views/styles/_check-box-radio-fields.php CHANGED
@@ -21,8 +21,9 @@
21
  <div class="field-group clearfix">
22
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
23
  <select name="<?php echo esc_attr( $frm_style->get_field_name('check_weight') ) ?>" id="frm_check_weight">
24
- <option value="normal" <?php selected($style->post_content['check_weight'], 'normal') ?>><?php _e( 'normal', 'formidable' ) ?></option>
25
- <option value="bold" <?php selected($style->post_content['check_weight'], 'bold') ?>><?php _e( 'bold', 'formidable' ) ?></option>
 
26
  </select>
27
  </div>
28
  <div class="field-group clearfix">
21
  <div class="field-group clearfix">
22
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
23
  <select name="<?php echo esc_attr( $frm_style->get_field_name('check_weight') ) ?>" id="frm_check_weight">
24
+ <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
25
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['check_weight'], $value ) ?>><?php echo $name ?></option>
26
+ <?php } ?>
27
  </select>
28
  </div>
29
  <div class="field-group clearfix">
classes/views/styles/_field-description.php CHANGED
@@ -5,8 +5,9 @@
5
  <div class="field-group clearfix frm-first-row">
6
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
7
  <select name="<?php echo esc_attr( $frm_style->get_field_name('description_weight') ) ?>" id="frm_description_weight">
8
- <option value="normal" <?php selected($style->post_content['description_weight'], 'normal') ?>><?php _e( 'normal', 'formidable' ) ?></option>
9
- <option value="bold" <?php selected($style->post_content['description_weight'], 'bold') ?>><?php _e( 'bold', 'formidable' ) ?></option>
 
10
  </select>
11
  </div>
12
  <div class="field-group clearfix frm-first-row">
5
  <div class="field-group clearfix frm-first-row">
6
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
7
  <select name="<?php echo esc_attr( $frm_style->get_field_name('description_weight') ) ?>" id="frm_description_weight">
8
+ <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
9
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['description_weight'], $value ) ?>><?php echo $name ?></option>
10
+ <?php } ?>
11
  </select>
12
  </div>
13
  <div class="field-group clearfix frm-first-row">
classes/views/styles/_field-labels.php CHANGED
@@ -5,8 +5,9 @@
5
  <div class="field-group clearfix frm-first-row">
6
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
7
  <select name="<?php echo esc_attr( $frm_style->get_field_name('weight') ) ?>" id="frm_weight">
8
- <option value="normal" <?php selected($style->post_content['weight'], 'normal') ?>>normal</option>
9
- <option value="bold" <?php selected($style->post_content['weight'], 'bold') ?>>bold</option>
 
10
  </select>
11
  </div>
12
  <div class="field-group clearfix frm-first-row">
@@ -50,8 +51,9 @@
50
  <div class="field-group clearfix after-h3">
51
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
52
  <select name="<?php echo esc_attr( $frm_style->get_field_name('required_weight') ) ?>" id="frm_required_weight">
53
- <option value="normal" <?php selected($style->post_content['required_weight'], 'normal') ?>><?php _e( 'normal', 'formidable' ) ?></option>
54
- <option value="bold" <?php selected($style->post_content['required_weight'], 'bold') ?>><?php _e( 'bold', 'formidable' ) ?></option>
 
55
  </select>
56
  </div>
57
  <div class="clear"></div>
5
  <div class="field-group clearfix frm-first-row">
6
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
7
  <select name="<?php echo esc_attr( $frm_style->get_field_name('weight') ) ?>" id="frm_weight">
8
+ <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
9
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['weight'], $value ) ?>><?php echo $name ?></option>
10
+ <?php } ?>
11
  </select>
12
  </div>
13
  <div class="field-group clearfix frm-first-row">
51
  <div class="field-group clearfix after-h3">
52
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
53
  <select name="<?php echo esc_attr( $frm_style->get_field_name('required_weight') ) ?>" id="frm_required_weight">
54
+ <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
55
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['required_weight'], $value ) ?>><?php echo $name ?></option>
56
+ <?php } ?>
57
  </select>
58
  </div>
59
  <div class="clear"></div>
classes/views/styles/_sample_form.php CHANGED
@@ -5,7 +5,8 @@
5
  </div>
6
 
7
  <div id="message" class="frm_message"><strong><?php echo __( 'SAMPLE:', 'formidable' ) .'</strong> '. $frm_settings->success_msg ?></div>
8
- <?php $pos_class = 'frm_pos_container '. ($style->post_content['position'] == 'none' ? 'frm_top_container' : 'frm_'. $style->post_content['position'] .'_container'); ?>
 
9
 
10
  <h3><?php _e( 'Form Title', 'formidable' ) ?></h3>
11
  <div class="frm_description"><p><?php _e( 'This is an example form description for styling purposes.', 'formidable' ) ?></p></div>
5
  </div>
6
 
7
  <div id="message" class="frm_message"><strong><?php echo __( 'SAMPLE:', 'formidable' ) .'</strong> '. $frm_settings->success_msg ?></div>
8
+
9
+ <?php $pos_class = 'frm_pos_container frm_' . ( $style->post_content['position'] == 'none' ? 'top' : ( $style->post_content['position'] == 'no_label' ? 'none' : $style->post_content['position'] ) ) . '_container'; ?>
10
 
11
  <h3><?php _e( 'Form Title', 'formidable' ) ?></h3>
12
  <div class="frm_description"><p><?php _e( 'This is an example form description for styling purposes.', 'formidable' ) ?></p></div>
classes/views/styles/_section-fields.php CHANGED
@@ -22,8 +22,9 @@
22
  <div class="field-group">
23
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
24
  <select name="<?php echo esc_attr( $frm_style->get_field_name('section_weight') ) ?>" id="frm_section_weight">
25
- <option value="normal" <?php selected($style->post_content['section_weight'], 'normal') ?>><?php _e( 'normal', 'formidable' ) ?></option>
26
- <option value="bold" <?php selected($style->post_content['section_weight'], 'bold') ?>><?php _e( 'bold', 'formidable' ) ?></option>
 
27
  </select>
28
  </div>
29
 
22
  <div class="field-group">
23
  <label><?php _e( 'Weight', 'formidable' ) ?></label>
24
  <select name="<?php echo esc_attr( $frm_style->get_field_name('section_weight') ) ?>" id="frm_section_weight">
25
+ <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
26
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['section_weight'], $value ) ?>><?php echo $name ?></option>
27
+ <?php } ?>
28
  </select>
29
  </div>
30
 
classes/widgets/FrmShowForm.php CHANGED
@@ -4,7 +4,7 @@ class FrmShowForm extends WP_Widget {
4
 
5
  public function __construct() {
6
  $widget_ops = array( 'description' => __( 'Display a Formidable Form', 'formidable' ) );
7
- $this->WP_Widget('frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops);
8
  }
9
 
10
  public function widget( $args, $instance ) {
4
 
5
  public function __construct() {
6
  $widget_ops = array( 'description' => __( 'Display a Formidable Form', 'formidable' ) );
7
+ parent::__construct('frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops);
8
  }
9
 
10
  public function widget( $args, $instance ) {
css/_single_theme.css.php CHANGED
@@ -250,7 +250,7 @@ if ( ! isset($collapse_icon) ) {
250
  display:inline<?php echo $important ?>;
251
  }
252
 
253
- .<?php echo $style_class ?> .frm_inline_container.frm_scale_container label.frm_primary_label{
254
  margin-right:10px<?php echo $important ?>;
255
  }
256
 
250
  display:inline<?php echo $important ?>;
251
  }
252
 
253
+ .<?php echo $style_class ?> .frm_inline_container label.frm_primary_label{
254
  margin-right:10px<?php echo $important ?>;
255
  }
256
 
css/custom_theme.css.php CHANGED
@@ -63,9 +63,7 @@ legend.frm_hidden{
63
  width:auto;
64
  }
65
 
66
- .with_frm_style .frm_inline_container label.frm_primary_label,
67
- .with_frm_style .frm_inline_container:not(.frm_dynamic_select_container) .frm_opt_container{
68
- display:inline;
69
  margin-right:10px;
70
  }
71
 
@@ -1133,7 +1131,8 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
1133
  .frm_form_field .frm_repeat_sec .frm_add_form_row{
1134
  opacity:0;
1135
  display:none;
1136
- *visibility:visible;
 
1137
  -moz-transition: opacity .15s ease-in-out;
1138
  -webkit-transition: opacity .15s ease-in-out;
1139
  transition: opacity .15s ease-in-out;
@@ -1270,6 +1269,12 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
1270
  margin-right:4px;
1271
  }
1272
 
 
 
 
 
 
 
1273
  .frm_clearfix:after{
1274
  content:".";
1275
  display:block;
@@ -1292,10 +1297,19 @@ html[xmlns] .frm_clearfix{
1292
  }
1293
 
1294
  /* Login form */
 
 
 
 
 
1295
  .with_frm_style.frm_login_form.frm_inline_login .login-remember input{
1296
  vertical-align:baseline;
1297
  }
1298
 
 
 
 
 
1299
  .with_frm_style.frm_login_form.frm_inline_login label{
1300
  display:inline;
1301
  }
@@ -1309,6 +1323,7 @@ html[xmlns] .frm_clearfix{
1309
 
1310
  .with_frm_style.frm_login_form.frm_inline_login form{
1311
  position:relative;
 
1312
  }
1313
 
1314
  .with_frm_style.frm_login_form.frm_inline_login .login-remember{
@@ -1332,6 +1347,8 @@ html[xmlns] .frm_clearfix{
1332
 
1333
  .with_frm_style .frm-open-login a{
1334
  text-decoration:none;
 
 
1335
  }
1336
 
1337
  .with_frm_style.frm_slide.frm_login_form form{
@@ -1870,6 +1887,21 @@ html[xmlns] .frm_clearfix{
1870
  .with_frm_style.frm_login_form.frm_inline_login .login-remember{
1871
  position:static;
1872
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1873
  }
1874
  <?php
1875
  echo $defaults['custom_css'];
63
  width:auto;
64
  }
65
 
66
+ .with_frm_style .frm_inline_container label.frm_primary_label{
 
 
67
  margin-right:10px;
68
  }
69
 
1131
  .frm_form_field .frm_repeat_sec .frm_add_form_row{
1132
  opacity:0;
1133
  display:none;
1134
+ *display:inline;
1135
+ display:inline\0/; /* For IE 8-9 */
1136
  -moz-transition: opacity .15s ease-in-out;
1137
  -webkit-transition: opacity .15s ease-in-out;
1138
  transition: opacity .15s ease-in-out;
1269
  margin-right:4px;
1270
  }
1271
 
1272
+ .frm_form_field.frm_capitalize input,
1273
+ .frm_form_field.frm_capitalize select,
1274
+ .frm_form_field.frm_capitalize .frm_opt_container label{
1275
+ text-transform:capitalize;
1276
+ }
1277
+
1278
  .frm_clearfix:after{
1279
  content:".";
1280
  display:block;
1297
  }
1298
 
1299
  /* Login form */
1300
+ .with_frm_style.frm_login_form,
1301
+ .with_frm_style.frm_login_form form{
1302
+ clear:both;
1303
+ }
1304
+
1305
  .with_frm_style.frm_login_form.frm_inline_login .login-remember input{
1306
  vertical-align:baseline;
1307
  }
1308
 
1309
+ .with_frm_style.frm_login_form.frm_inline_login .login-submit{
1310
+ float:left;
1311
+ }
1312
+
1313
  .with_frm_style.frm_login_form.frm_inline_login label{
1314
  display:inline;
1315
  }
1323
 
1324
  .with_frm_style.frm_login_form.frm_inline_login form{
1325
  position:relative;
1326
+ clear:none;
1327
  }
1328
 
1329
  .with_frm_style.frm_login_form.frm_inline_login .login-remember{
1347
 
1348
  .with_frm_style .frm-open-login a{
1349
  text-decoration:none;
1350
+ border:none;
1351
+ outline:none;
1352
  }
1353
 
1354
  .with_frm_style.frm_slide.frm_login_form form{
1887
  .with_frm_style.frm_login_form.frm_inline_login .login-remember{
1888
  position:static;
1889
  }
1890
+
1891
+ .with_frm_style .g-recaptcha > div > div{
1892
+ width:inherit !important;
1893
+ display:block;
1894
+ overflow:hidden;
1895
+ max-width:302px;
1896
+ border-right:1px solid #d3d3d3;
1897
+ border-radius:4px;
1898
+ box-shadow:2px 0px 4px -1px rgba(0,0,0,.08);
1899
+ -moz-box-shadow:2px 0px 4px -1px rgba(0,0,0,.08);
1900
+ }
1901
+
1902
+ .with_frm_style .g-recaptcha iframe{
1903
+ width:100%;
1904
+ }
1905
  }
1906
  <?php
1907
  echo $defaults['custom_css'];
css/frm_admin.css CHANGED
@@ -819,6 +819,7 @@ table td, .form-table tr td{vertical-align:top;}
819
  }
820
  .sortable-placeholder{
821
  width:100% !important;
 
822
  }
823
 
824
  .frm-show-click,
@@ -1794,7 +1795,7 @@ select.texture{display: none;}
1794
  #wp-content-editor-tools{
1795
  background-color:transparent;
1796
  }
1797
- #frm_adv_info{position:fixed;z-index:5;width:280px;}
1798
  .frm_noallow{
1799
  opacity:.5;
1800
  filter:alpha(opacity=50);
@@ -1823,11 +1824,6 @@ iframe#dyncontent_ifr{min-height:150px;}
1823
 
1824
  .frm_uninstall a.button{margin-top:1px;}
1825
 
1826
- #message.fade:not(.out),
1827
- .frm_message.fade:not(.out){
1828
- opacity:1;
1829
- }
1830
-
1831
  /*!
1832
  * Bootstrap v3.0.2
1833
  */
@@ -1850,16 +1846,6 @@ iframe#dyncontent_ifr{min-height:150px;}
1850
  .tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#6D6D6D;}
1851
  .tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#6D6D6D;}
1852
 
1853
- .fade {
1854
- opacity: 0;
1855
- -webkit-transition: opacity 0.15s linear;
1856
- transition: opacity 0.15s linear;
1857
- }
1858
-
1859
- .fade.in {
1860
- opacity: 1;
1861
- }
1862
-
1863
  .frm_progress {
1864
  overflow: hidden;
1865
  height: 20px;
819
  }
820
  .sortable-placeholder{
821
  width:100% !important;
822
+ height:80px;
823
  }
824
 
825
  .frm-show-click,
1795
  #wp-content-editor-tools{
1796
  background-color:transparent;
1797
  }
1798
+ #frm_adv_info{position:fixed;z-index:9999;width:280px;}
1799
  .frm_noallow{
1800
  opacity:.5;
1801
  filter:alpha(opacity=50);
1824
 
1825
  .frm_uninstall a.button{margin-top:1px;}
1826
 
 
 
 
 
 
1827
  /*!
1828
  * Bootstrap v3.0.2
1829
  */
1846
  .tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#6D6D6D;}
1847
  .tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#6D6D6D;}
1848
 
 
 
 
 
 
 
 
 
 
 
1849
  .frm_progress {
1850
  overflow: hidden;
1851
  height: 20px;
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.0.10
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.0.11
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -130,20 +130,26 @@ function frmFrontFormJS(){
130
 
131
  checkDependentField('und', field_id, null, jQuery(this), reset);
132
  doCalculation(field_id, jQuery(this));
 
133
  }
134
 
135
  /* Get the ID of the field that changed*/
136
- function getFieldId( field ) {
137
  var fieldName = '';
138
  if ( field instanceof jQuery ) {
139
  fieldName = field.attr('name');
140
  } else {
141
  fieldName = field.name;
142
  }
143
- var nameParts = fieldName.replace('item_meta[', '').split(']');
 
144
  var field_id = nameParts[0];
145
  var isRepeating = false;
146
 
 
 
 
 
147
  // Check if 'this' is in a repeating section
148
  if ( jQuery('input[name="item_meta['+ field_id +'][form]"]').length ) {
149
  // this is a repeatable section with name: item_meta[370][0][414]
@@ -162,6 +168,11 @@ function frmFrontFormJS(){
162
  }
163
  }
164
 
 
 
 
 
 
165
  return field_id;
166
  }
167
 
@@ -364,7 +375,7 @@ function frmFrontFormJS(){
364
  }
365
  }
366
 
367
- if ( selected === '' || selected.length < 1 ) {
368
  show_fields[f.hideContainerID][i] = false;
369
  } else {
370
  show_fields[f.hideContainerID][i] = {'funcName':'getDataOpts', 'f':f, 'sel':selected};
@@ -467,7 +478,7 @@ function frmFrontFormJS(){
467
  }
468
  }
469
 
470
- if ( i === false ) {
471
  triggerChange( jQuery(this) );
472
  }
473
  i = true;
@@ -483,12 +494,30 @@ function frmFrontFormJS(){
483
  function showFieldAndSetValue( container, f ) {
484
  var inputs = getInputsInContainer( container );
485
  setDefaultValue( inputs );
486
- doCalcForSingleField( f.HideField, inputs );
 
 
 
 
 
 
 
 
487
  container.show();
488
  }
489
 
490
  function setDefaultValue( input ) {
491
  var inputLenth = input.length;
 
 
 
 
 
 
 
 
 
 
492
  if ( inputLenth ) {
493
  for ( var i = 0, l = inputLenth; i < l; i++ ) {
494
  var field = jQuery(input[i]);
@@ -510,6 +539,11 @@ function frmFrontFormJS(){
510
  if ( typeof fieldKey === 'undefined' ) {
511
  fieldKey = 'dependent';
512
  }
 
 
 
 
 
513
  input.trigger({ type:'change', selfTriggered:true, frmTriggered:fieldKey });
514
  }
515
 
@@ -804,10 +838,8 @@ function frmFrontFormJS(){
804
  // loop through each calculation this field is used in
805
  for ( var i = 0, l = len; i < l; i++ ) {
806
 
807
- // If field is hidden with conditional logic or if it's on a different page, don't do the calc
808
- var calcFieldId = all_calcs.calc[ keys[i] ].field_id;
809
- var t = document.getElementById( 'frm_field_' + calcFieldId + '_container' );
810
- if ( t !== null && t.offsetHeight === 0 ) {
811
  continue;
812
  }
813
 
@@ -815,6 +847,40 @@ function frmFrontFormJS(){
815
  }
816
  }
817
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
818
  function doSingleCalculation( all_calcs, field_key, vals, triggerField ) {
819
  var thisCalc = all_calcs.calc[ field_key ];
820
  var thisFullCalc = thisCalc.calc;
@@ -941,19 +1007,20 @@ function frmFrontFormJS(){
941
  if ( d !== null ) {
942
  vals[field.valKey] = Math.ceil(d/(1000*60*60*24));
943
  }
944
- }
945
-
946
- var n = thisVal;
947
 
948
- if ( n !== '' && n !== 0 ) {
949
- n = n.trim();
950
- n = parseFloat(n.replace(/,/g,'').match(/-?[\d\.]+$/));
951
- }
952
 
953
- if ( typeof n === 'undefined' || isNaN(n) || n === '' ) {
954
- n = 0;
 
 
955
  }
956
- vals[field.valKey] += n;
957
  });
958
 
959
  return vals;
@@ -963,17 +1030,11 @@ function frmFrontFormJS(){
963
  if ( typeof field.triggerField === 'undefined' ) {
964
  return null;
965
  }
 
966
  var container = field.triggerField.closest('.frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid');
967
  if ( container.length ) {
968
- var inputClass = '.frm_field_'+ field.thisFieldId +'_container ';
969
- var fieldCallParts = field.thisFieldCall.split(',');
970
- var siblingFieldCall = '';
971
- for ( var i = 0, l = fieldCallParts.length; i < l; i++ ) {
972
- if ( siblingFieldCall !== '' ) {
973
- siblingFieldCall = siblingFieldCall +',';
974
- }
975
- siblingFieldCall = siblingFieldCall + inputClass + fieldCallParts[i].replace('[id=', '[id^=');
976
- }
977
  return container.find(siblingFieldCall);
978
  }
979
  return null;
@@ -1092,12 +1153,43 @@ function frmFrontFormJS(){
1092
  errors = checkEmailField( emailFields[e], errors, emailFields );
1093
  }
1094
  }
 
 
 
 
 
 
 
 
1095
  return errors;
1096
  }
1097
 
1098
- function checkRequiredField( field, errors ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1099
  if ( jQuery(field).val() === '' ) {
1100
- var rFieldID = getFieldId( field );
1101
  errors[ rFieldID ] = '';
1102
  }
1103
  return errors;
@@ -1105,7 +1197,7 @@ function frmFrontFormJS(){
1105
 
1106
  function checkEmailField( field, errors, emailFields ) {
1107
  var emailAddress = field.value;
1108
- var fieldID = getFieldId( field );
1109
  var isConf = (fieldID.indexOf('conf_') === 0);
1110
  if ( emailAddress !== '' || isConf ) {
1111
  var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
@@ -1126,6 +1218,19 @@ function frmFrontFormJS(){
1126
  return errors;
1127
  }
1128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1129
  function getFormErrors(object, action){
1130
  jQuery(object).find('input[type="submit"], input[type="button"]').attr('disabled','disabled');
1131
  jQuery(object).find('.frm_ajax_loading').addClass('frm_loading_now');
@@ -1206,13 +1311,8 @@ function frmFrontFormJS(){
1206
  show_captcha = true;
1207
  grecaptcha.reset();
1208
  }
1209
-
1210
- $fieldCont.addClass('frm_blank_field');
1211
- if ( typeof frmThemeOverride_frmPlaceError == 'function' ) {
1212
- frmThemeOverride_frmPlaceError(key,errObj);
1213
- } else {
1214
- $fieldCont.append('<div class="frm_error">'+errObj[key]+'</div>');
1215
- }
1216
  }
1217
  }else if(key == 'redirect'){
1218
  window.location = errObj[key];
@@ -1233,6 +1333,22 @@ function frmFrontFormJS(){
1233
  });
1234
  }
1235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1236
  function clearDefault(){
1237
  /*jshint validthis:true */
1238
  toggleDefault(jQuery(this), 'clear');
@@ -1578,7 +1694,7 @@ function frmFrontFormJS(){
1578
  if ( jQuery.inArray(fieldID, checked ) == -1 ) {
1579
  checked.push(fieldID);
1580
  checkDependentField('und', fieldID, null, jQuery(this), reset);
1581
- doCalculation(fieldID);
1582
  reset = 'persist';
1583
  }
1584
  }
@@ -1752,24 +1868,16 @@ function frmFrontFormJS(){
1752
  jsErrors = [];
1753
  frmFrontForm.getAjaxFormErrors( object );
1754
 
1755
- if ( jsErrors.length === 0 ) {
1756
  getFormErrors( object, action );
1757
  } else {
1758
  // Remove all previous errors
1759
  jQuery('.form-field').removeClass('frm_blank_field');
1760
  jQuery('.form-field .frm_error').replaceWith('');
1761
 
1762
- var $fieldCont = null;
1763
  for ( var key in jsErrors ) {
1764
- $fieldCont = jQuery(object).find(jQuery(document.getElementById('frm_field_'+key+'_container')));
1765
- if ( $fieldCont.length && $fieldCont.is(':visible') ) {
1766
- $fieldCont.addClass('frm_blank_field');
1767
- if ( typeof frmThemeOverride_frmPlaceError == 'function' ) {
1768
- frmThemeOverride_frmPlaceError( key, jsErrors );
1769
- } else {
1770
- $fieldCont.append( '<div class="frm_error">'+ jsErrors[key] +'</div>' );
1771
- }
1772
- }
1773
  }
1774
  }
1775
  },
130
 
131
  checkDependentField('und', field_id, null, jQuery(this), reset);
132
  doCalculation(field_id, jQuery(this));
133
+ //validateField( field_id, this );
134
  }
135
 
136
  /* Get the ID of the field that changed*/
137
+ function getFieldId( field, fullID ) {
138
  var fieldName = '';
139
  if ( field instanceof jQuery ) {
140
  fieldName = field.attr('name');
141
  } else {
142
  fieldName = field.name;
143
  }
144
+ var nameParts = fieldName.replace('item_meta[', '').replace('[]', '').split(']');
145
+ nameParts = nameParts.filter(function(n){ return n !== ''; });
146
  var field_id = nameParts[0];
147
  var isRepeating = false;
148
 
149
+ if ( nameParts.length === 1 ) {
150
+ return field_id;
151
+ }
152
+
153
  // Check if 'this' is in a repeating section
154
  if ( jQuery('input[name="item_meta['+ field_id +'][form]"]').length ) {
155
  // this is a repeatable section with name: item_meta[370][0][414]
168
  }
169
  }
170
 
171
+ if ( fullID === true ) {
172
+ // For use in the container div id
173
+ field_id = field_id +'-'+ nameParts[0] +'-'+ nameParts[1].replace('[', '');
174
+ }
175
+
176
  return field_id;
177
  }
178
 
375
  }
376
  }
377
 
378
+ if ( selected === null || selected === '' || selected.length < 1 ) {
379
  show_fields[f.hideContainerID][i] = false;
380
  } else {
381
  show_fields[f.hideContainerID][i] = {'funcName':'getDataOpts', 'f':f, 'sel':selected};
478
  }
479
  }
480
 
481
+ if ( i === false || ["checkbox","radio"].indexOf( this.type ) < 0 ) {
482
  triggerChange( jQuery(this) );
483
  }
484
  i = true;
494
  function showFieldAndSetValue( container, f ) {
495
  var inputs = getInputsInContainer( container );
496
  setDefaultValue( inputs );
497
+
498
+ if ( inputs.length > 1 ) {
499
+ for ( var i = 0; i < inputs.length; i++ ) {
500
+ doCalcForSingleField( f.HideField, jQuery( inputs[i] ) );
501
+ }
502
+ } else {
503
+ doCalcForSingleField( f.HideField, inputs );
504
+ }
505
+
506
  container.show();
507
  }
508
 
509
  function setDefaultValue( input ) {
510
  var inputLenth = input.length;
511
+
512
+ // If the field already has a value (i.e. when form is loaded for editing an entry), don't get the default value
513
+ if ( input.is(':checkbox, :radio') ) {
514
+ if ( input.is(':checked') ) {
515
+ return;
516
+ }
517
+ } else if ( input.val() ) {
518
+ return;
519
+ }
520
+
521
  if ( inputLenth ) {
522
  for ( var i = 0, l = inputLenth; i < l; i++ ) {
523
  var field = jQuery(input[i]);
539
  if ( typeof fieldKey === 'undefined' ) {
540
  fieldKey = 'dependent';
541
  }
542
+
543
+ if ( input.length > 1 ) {
544
+ input = input.eq(0);
545
+ }
546
+
547
  input.trigger({ type:'change', selfTriggered:true, frmTriggered:fieldKey });
548
  }
549
 
838
  // loop through each calculation this field is used in
839
  for ( var i = 0, l = len; i < l; i++ ) {
840
 
841
+ // Stop calculation if total field is conditionally hidden
842
+ if ( fieldIsConditionallyHidden( all_calcs, triggerField, keys[i] ) ) {
 
 
843
  continue;
844
  }
845
 
847
  }
848
  }
849
 
850
+ /**
851
+ * If field is hidden with conditional logic, don't do the calc
852
+ */
853
+ function fieldIsConditionallyHidden( all_calcs, triggerField, field_key ) {
854
+ var totalFieldId = all_calcs.calc[ field_key ].field_id;
855
+ var t = document.getElementById( 'frm_field_' + totalFieldId + '_container' );
856
+ if ( t !== null ) {
857
+ if ( t.offsetHeight === 0 ) {
858
+ // Conditionally hidden field
859
+ return true;
860
+ } else {
861
+ // Regular, visible field
862
+ return false;
863
+ }
864
+ }
865
+
866
+ // Check if we're dealing with a conditionally hidden repeating field
867
+ var container = triggerField.closest('.frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid');
868
+ if ( container.length ) {
869
+ var idPart = container[0].id.replace( 'frm_section_', '' );
870
+ var totalField = document.getElementById( 'frm_field_' + totalFieldId + '-' + idPart + '_container' );
871
+ if ( totalField !== null && totalField.offsetHeight === 0 ) {
872
+ // Conditionally hidden field (repeating)
873
+ return true;
874
+ } else {
875
+ // Regular, visible field or hidden field (repeating)
876
+ return false;
877
+ }
878
+ } else {
879
+ // Hidden field
880
+ return false;
881
+ }
882
+ }
883
+
884
  function doSingleCalculation( all_calcs, field_key, vals, triggerField ) {
885
  var thisCalc = all_calcs.calc[ field_key ];
886
  var thisFullCalc = thisCalc.calc;
1007
  if ( d !== null ) {
1008
  vals[field.valKey] = Math.ceil(d/(1000*60*60*24));
1009
  }
1010
+ } else {
1011
+ var n = thisVal;
 
1012
 
1013
+ if ( n !== '' && n !== 0 ) {
1014
+ n = n.trim();
1015
+ n = parseFloat(n.replace(/,/g,'').match(/-?[\d\.]+$/));
1016
+ }
1017
 
1018
+ if ( typeof n === 'undefined' || isNaN(n) || n === '' ) {
1019
+ n = 0;
1020
+ }
1021
+ vals[field.valKey] += n;
1022
  }
1023
+
1024
  });
1025
 
1026
  return vals;
1030
  if ( typeof field.triggerField === 'undefined' ) {
1031
  return null;
1032
  }
1033
+
1034
  var container = field.triggerField.closest('.frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid');
1035
  if ( container.length ) {
1036
+ var siblingFieldCall = field.thisFieldCall.replace('[id=', '[id^=');
1037
+
 
 
 
 
 
 
 
1038
  return container.find(siblingFieldCall);
1039
  }
1040
  return null;
1153
  errors = checkEmailField( emailFields[e], errors, emailFields );
1154
  }
1155
  }
1156
+
1157
+ var numberFields = jQuery(object).find('input[type=number]');
1158
+ if ( numberFields.length ) {
1159
+ for ( var n = 0, nl = numberFields.length; n < nl; n++ ) {
1160
+ errors = checkNumberField( numberFields[n], errors );
1161
+ }
1162
+ }
1163
+
1164
  return errors;
1165
  }
1166
 
1167
+ function validateField( fieldId, field ) {
1168
+ var errors = [];
1169
+ var $fieldCont = jQuery(field).closest('.frm_form_field');
1170
+ if ( $fieldCont.hasClass('.frm_required_field') ) {
1171
+ errors = checkRequiredField( field, errors );
1172
+ }
1173
+
1174
+ if ( errors.length < 1 ) {
1175
+ if ( field.type == 'email' ) {
1176
+ var emailFields = jQuery(field).closest('form').find('input[type=email]');
1177
+ errors = checkEmailField( field, errors, emailFields );
1178
+ }
1179
+ }
1180
+
1181
+ if ( Object.keys(errors).length > 0 ) {
1182
+ for ( var key in errors ) {
1183
+ addFieldError( $fieldCont, key, errors );
1184
+ }
1185
+ } else {
1186
+ removeFieldError( $fieldCont );
1187
+ }
1188
+ }
1189
+
1190
+ function checkRequiredField( field, errors, rFieldID ) {
1191
  if ( jQuery(field).val() === '' ) {
1192
+ rFieldID = getFieldId( field, true );
1193
  errors[ rFieldID ] = '';
1194
  }
1195
  return errors;
1197
 
1198
  function checkEmailField( field, errors, emailFields ) {
1199
  var emailAddress = field.value;
1200
+ var fieldID = getFieldId( field, true );
1201
  var isConf = (fieldID.indexOf('conf_') === 0);
1202
  if ( emailAddress !== '' || isConf ) {
1203
  var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
1218
  return errors;
1219
  }
1220
 
1221
+ function checkNumberField( field, errors ) {
1222
+ var number = field.value;
1223
+ if ( isNaN(number / 1) !== false ) {
1224
+ var fieldID = getFieldId( field, true );
1225
+ errors[ fieldID ] = '';
1226
+ }
1227
+ return errors;
1228
+ }
1229
+
1230
+ function checkDateField( field, errors ) {
1231
+ return errors;
1232
+ }
1233
+
1234
  function getFormErrors(object, action){
1235
  jQuery(object).find('input[type="submit"], input[type="button"]').attr('disabled','disabled');
1236
  jQuery(object).find('.frm_ajax_loading').addClass('frm_loading_now');
1311
  show_captcha = true;
1312
  grecaptcha.reset();
1313
  }
1314
+
1315
+ addFieldError( $fieldCont, key, errObj );
 
 
 
 
 
1316
  }
1317
  }else if(key == 'redirect'){
1318
  window.location = errObj[key];
1333
  });
1334
  }
1335
 
1336
+ function addFieldError( $fieldCont, key, jsErrors ) {
1337
+ if ( $fieldCont.length && $fieldCont.is(':visible') ) {
1338
+ $fieldCont.addClass('frm_blank_field');
1339
+ if ( typeof frmThemeOverride_frmPlaceError == 'function' ) {
1340
+ frmThemeOverride_frmPlaceError( key, jsErrors );
1341
+ } else {
1342
+ $fieldCont.append( '<div class="frm_error">'+ jsErrors[key] +'</div>' );
1343
+ }
1344
+ }
1345
+ }
1346
+
1347
+ function removeFieldError( $fieldCont ) {
1348
+ $fieldCont.removeClass('frm_blank_field');
1349
+ $fieldCont.find('.frm_error').remove();
1350
+ }
1351
+
1352
  function clearDefault(){
1353
  /*jshint validthis:true */
1354
  toggleDefault(jQuery(this), 'clear');
1694
  if ( jQuery.inArray(fieldID, checked ) == -1 ) {
1695
  checked.push(fieldID);
1696
  checkDependentField('und', fieldID, null, jQuery(this), reset);
1697
+ doCalculation(fieldID, jQuery(this));
1698
  reset = 'persist';
1699
  }
1700
  }
1868
  jsErrors = [];
1869
  frmFrontForm.getAjaxFormErrors( object );
1870
 
1871
+ if ( Object.keys(jsErrors).length === 0 ) {
1872
  getFormErrors( object, action );
1873
  } else {
1874
  // Remove all previous errors
1875
  jQuery('.form-field').removeClass('frm_blank_field');
1876
  jQuery('.form-field .frm_error').replaceWith('');
1877
 
 
1878
  for ( var key in jsErrors ) {
1879
+ var $fieldCont = jQuery(object).find(jQuery('#frm_field_'+key+'_container'));
1880
+ addFieldError( $fieldCont, key, jsErrors );
 
 
 
 
 
 
 
1881
  }
1882
  }
1883
  },
js/formidable.min.js CHANGED
@@ -1,63 +1,64 @@
1
  function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",f=this.name;if("frm_prev_page"===f||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===f||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function n(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
2
- jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){this.className=this.className.replace("frm_transparent","");this.parentNode.getElementsByTagName("a")[0].className.indexOf("frm_clear_file_link")}function v(){var a=this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,
3
  b=!1,f=0;f<d.length;f++)if("frm_other_trigger"===d[f].className&&d[f].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value="")):"radio"===a?jQuery(this).is(":checked")&&(jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):
4
- "checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function w(a){var b;b="";b=this instanceof jQuery?this.attr("name"):this.name;b=b.replace("item_meta[","").split("]");var c=b[0],d=!1;jQuery('input[name="item_meta['+c+'][form]"]').length&&(c=b[2].replace("[",""),d=!0);"other"===c&&(c=d?b[3].replace("[",""):b[1].replace("[",
5
- ""));if((b=c)&&"undefined"!==typeof b){c="reset";if(a.frmTriggered){if(a.frmTriggered==b)return;c="persist"}q("und",b,null,jQuery(this),c);E(b,jQuery(this))}}function q(a,b,c,d,f){var e;if("undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[b])e=void 0;else{e=__FRMRULES[b];for(var h=[],g=0,k=e.length;g<k;g++){var l=e[g];if("undefined"!==typeof l)for(var F=0,n=l.Conditions.length;F<n;F++){var p=l.Conditions[F];p.HideField=l.Setting.FieldName;p.MatchType=l.MatchType;p.Show=l.Show;h.push(p)}}e=
6
- h}if("undefined"!==typeof e){if("undefined"===typeof c||null===c)c="go";"persist"!==f&&(m=[],D=[]);f=d;h=!1;""===x&&"undefined"!==typeof f&&null!==f&&(1<f.length&&(f=f.eq(0)),h=f.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid"),"undefined"!==typeof h?(x=h.attr("id"),h=!0):h=!1);f=h;h=e.length;for(g=0;g<h;g++)e[g].FieldName===b?r(g,e[g],b,a,c,d):r(g,e[g],b,a,c),g===h-1&&(V(c),f&&(x=""))}}function r(a,b,c,d,f,e){b.inputName="item_meta["+b.FieldName+"]";b.hiddenName="item_meta["+b.HideField+
7
- "]";b.containerID="frm_field_"+b.FieldName+"_container";b.hideContainerID="frm_field_"+b.HideField+"_container";b.hideBy="#";var h=!1;if("undefined"!==typeof e&&null!==e){1<e.length&&(e=e.eq(0));if("undefined"===typeof e.attr("name"))return;b.inputName=e.attr("name").replace("[other]","").replace("[]","");var g=e.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");g.length&&(g=g.find(".frm_field_"+b.FieldName+"_container"),b.containerID=g.attr("id"),b.hideContainerID=b.containerID.replace(b.FieldName,
8
- b.HideField),b.hiddenName=b.inputName.replace("["+b.FieldName+"]","["+b.HideField+"]"))}else{u(b);h=!0;e=jQuery('input[name^="'+b.inputName+'"], textarea[name^="'+b.inputName+'"], select[name^="'+b.inputName+'"]');if(1>e.length&&(g="."+b.containerID,""!==x&&(g="#"+x+" "+g),g=jQuery(g),g.length)){e=g.find("input, textarea, select");if(e.length)if(""===x){var k="";e.each(function(){var c=jQuery(this).closest(".frm_form_field").attr("id");c!=k&&r(a,b,b.FieldName,d,f,jQuery(this));k=c})}else r(a,b,c,
9
- d,f,e);else m[b.hideContainerID][a]=!1,K(a,b,f);return}1<e.length&&(e=e.eq(0))}u(b);null===document.getElementById(b.hideContainerID)&&(b.hideBy=".");if(b.FieldName!==c||"undefined"===typeof d||"und"===d)if(("radio"===b.Type||"data-radio"===b.Type)&&"radio"===e.attr("type"))d=jQuery('input[name="'+b.inputName+'"]:checked').val(),"undefined"===typeof d&&(d="");else if("select"===b.Type||"time"===b.Type||"data-select"===b.Type||"checkbox"!==b.Type&&"data-checkbox"!==b.Type)d=e.val();if("undefined"===
10
- typeof d){if(0===e.length)return;d=e.val()}if("undefined"===typeof d){if(!0===h&&(c=jQuery("."+b.containerID+" input, ."+b.containerID+" select, ."+b.containerID+" textarea"),c.length)){c.each(function(){r(a,b,b.FieldName,d,f,jQuery(this))});return}d=""}c=[];if("checkbox"===b.Type||"data-checkbox"===b.Type)c=W(b.containerID,b.inputName),d=c.length?c:"";m[b.hideContainerID][a]=""===d||1>d.length?!1:{funcName:"getDataOpts",f:b,sel:d};if("checkbox"===b.Type||"data-checkbox"===b.Type&&"undefined"===typeof b.LinkedField)if(c=
11
- m[b.hideContainerID][a]=!1,""!==d)for("!="===b.Condition&&(m[b.hideContainerID][a]=!0),e=0;e<d.length;e++)c=z(b.Condition,b.Value,d[e]),"!="===b.Condition?!0===m[b.hideContainerID][a]&&!1===c&&(m[b.hideContainerID][a]=!1):!1===m[b.hideContainerID][a]&&c&&(m[b.hideContainerID][a]=!0);else c=z(b.Condition,b.Value,""),!1===m[b.hideContainerID][a]&&c&&(m[b.hideContainerID][a]=!0);else if("undefined"!==typeof b.LinkedField&&0===b.Type.indexOf("data-")){if("undefined"===typeof b.DataType||"data"===b.DataType)""===
12
- d?y(b.hideContainerID,b.hideBy,b.HideField,"hide"):"data-radio"===b.Type?m[b.hideContainerID][a]="undefined"===typeof b.DataType?z(b.Condition,b.Value,d):{funcName:"getData",f:b,sel:d}:"data-checkbox"===b.Type||"data-select"===b.Type&&X(d)?(y(b.hideContainerID,b.hideBy,b.HideField,"show"),m[b.hideContainerID][a]=!0,L(b,d,1)):"data-select"===b.Type&&(m[b.hideContainerID][a]={funcName:"getData",f:b,sel:d})}else"undefined"===typeof b.Value&&0===b.Type.indexOf("data")?(b.Value=""===d?"1":d,m[b.hideContainerID][a]=
13
- z(b.Condition,b.Value,d),b.Value=void 0):m[b.hideContainerID][a]=z(b.Condition,b.Value,d);K(a,b,f)}function u(a){"undefined"===typeof m[a.hideContainerID]&&(m[a.hideContainerID]=[])}function y(a,b,c,d){-1===jQuery.inArray(a,D)&&(D[c]=a,a="."===b?jQuery("."+a):jQuery(document.getElementById(a)),"hide"===d&&a.hide(),a.find(".frm_data_field_container").empty())}function A(a,b){a.hide();if(-1===jQuery.inArray(a.attr("id"),D)){D[b.HideField]=a.attr("id");var c=M(a);if(c.length){c.prop("checked",!1).prop("selectedIndex",
14
- 0);c.not(":checkbox, :radio, select").val("");var d=!1;c.each(function(){"SELECT"==this.tagName&&null!==document.getElementById(this.id+"_chosen")&&jQuery(this).trigger("chosen:updated");!1===d&&B(jQuery(this));d=!0})}}}function M(a){return a.find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]:not([type=hidden])')}function N(a,b){var c=M(a),d=c.length;if(d)for(var f=0;f<d;f++){var e=jQuery(c[f]),h=e.data("frmval");if("undefined"!==typeof h)if(!e.is(":checkbox, :radio"))e.val(h),
15
- B(e);else if(e.val()==h||jQuery.isArray(h)&&-1!==jQuery.inArray(e.val(),h))e.prop("checked",!0),B(e)}"undefined"!==typeof __FRMCALC&&(d=__FRMCALC,f=d.fieldsWithCalc[b.HideField],"undefined"!==typeof f&&O(d,f,[],c));a.show()}function B(a,b){"undefined"===typeof b&&(b="dependent");a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function K(a,b,c){if("all"===b.MatchType||!1===m[b.hideContainerID][a])G.push({result:m[b.hideContainerID][a],show:b.Show,match:b.MatchType,FieldName:b.FieldName,
16
- HideField:b.HideField,hideContainerID:b.hideContainerID,hideBy:b.hideBy});else{var d="none";if("show"===b.Show){if(!0!==m[b.hideContainerID][a]){P(m[b.hideContainerID][a],b.FieldName,c);return}d=""}a="."===b.hideBy?jQuery("."+b.hideContainerID):jQuery(document.getElementById(b.hideContainerID));a.length&&("none"===d?A(a,b):N(a,b))}}function V(a){jQuery.each(G,function(b,c){delete G[b];if("undefined"!==typeof c&&"undefined"!==typeof c.result){var d=jQuery(c.hideBy+c.hideContainerID),f=c.show;if(d.length){if("any"===
17
- c.match&&-1===jQuery.inArray(!0,m[c.hideContainerID])||"all"===c.match&&-1<jQuery.inArray(!1,m[c.hideContainerID]))f="show"===c.show?"hide":"show";"show"===f?(N(d,c),!1!==typeof c.result&&!0!==typeof c.result&&P(c.result,c.FieldName,a)):A(d,c)}}})}function z(a,b,c){"undefined"===typeof c&&(c="");jQuery.isArray(c)&&-1<jQuery.inArray(b,c)&&(c=b);-1!==String(b).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)&&(b=parseFloat(b),c=parseFloat(c));return"-1"!=String(b).indexOf("&quot;")&&z(a,b.replace("&quot;",
18
- '"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){return b?-1!=b.indexOf(a):0},"not LIKE":function(a,b){return b?-1==b.indexOf(a):1}}[a](b,c)}function P(a,b,c){"getDataOpts"==a.funcName?Y(a.f,a.sel,b,c):"getData"==a.funcName&&L(a.f,a.sel,0)}function L(a,b,c){var d=document.getElementById(a.hideContainerID),f=jQuery(d).find(".frm_data_field_container");if(0===f.length)return!0;c||f.html('<span class="frm-loading-img"></span>');
19
- jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:b,field_id:a.LinkedField,current_field:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(a){c?f.append(a):f.html(a);var b=f.children("input"),g=b.val();d.style.display=""===a&&!c||""===g?"none":"";B(b);return!0}})}function Y(a,b,c,d){if(!("stop"==d&&-1<jQuery.inArray(a.HideField,H)&&a.parentField&&"hidden"==a.parentField.attr("type"))){var f=jQuery('input[name^="'+a.hiddenName+'"], select[name^="'+
20
- a.hiddenName+'"]:not(":disabled"), textarea[name^="'+a.hiddenName+'"]'),e=[];f.each(function(){"radio"===this.type||"checkbox"===this.type?!0===this.checked&&e.push(jQuery(this).val()):e.push(jQuery(this).val())});if("select"!=a.DataType||"stop"!=d&&!jQuery("#"+a.hideContainerID+" .frm-loading-img").length||!(-1<jQuery.inArray(a.HideField,H))){0===e.length&&(e="");H.push(a.HideField);var h=document.getElementById(a.hideContainerID),g=jQuery(h).find(".frm_data_field_container");if(0===g.length&&f.length)return q(e,
21
- a.HideField,"stop",f),!1;if(""!==a.Value&&!z(a.Condition,a.Value,b))return h.style.display="none",g.html(""),q("",a.HideField,"stop",f),!1;g.html('<span class="frm-loading-img" style="visibility:visible;display:inline;"></span>');var k=a.DataType;jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",hide_field:c,entry_id:b,selected_field_id:a.LinkedField,field_id:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(b){g.html(b);var c=g.find("select, input, textarea"),
22
- d=1;"hidden"==c.attr("type")&&(d=c.val());""===b||""===d?(h.style.display="none",e=""):"all"!=a.MatchType&&(h.style.display="");""!==b&&""!==e&&(jQuery.isArray(e)||(b=[],b.push(e),e=b),jQuery.each(e,function(a,b){if("undefined"!==typeof b&&""!==b)if("checkbox"==k||"radio"==k)1<c.length?c.filter('[value="'+b+'"]').attr("checked","checked"):c.val()==b&&c.attr("checked","checked");else if("select"==k){var d=c.children('option[value="'+b+'"]');d.length?d.prop("selected",!0):e.splice(a,1)}else c.val(b)}));
23
- c.hasClass("frm_chzn")&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});B(c)}})}}}function E(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=d.total,f=[],e=0,h=d.length;e<h;e++){var g=document.getElementById("frm_field_"+c.calc[d[e]].field_id+"_container");null!==g&&0===g.offsetHeight||O(c,d[e],f,b)}}}function O(a,b,c,d){var f=a.calc[b],e=f.calc,h=jQuery(document.getElementById("field_"+b)),g={triggerField:d,inSection:!1,
24
- thisFieldCall:'input[id^="field_'+b+'-"]'};1>h.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=Z(a.fieldsWithCalc,b),h=Q(g));e=aa(f,e,a,c,g);a=f.calc_dec;e.indexOf(").toFixed(")&&(c=e.split(").toFixed("),R(c[1])&&(a=c[1],e=e.replace(").toFixed("+a,"")));e=parseFloat(eval(e));R(a)&&(e=e.toFixed(a));"undefined"===typeof e&&(e=0);h.val()!=e&&(h.val(e),B(h,b))}function aa(a,b,c,d,f){for(var e=0,h=a.fields.length;e<h;e++){var g={triggerField:f.triggerField,thisFieldId:a.fields[e],inSection:f.inSection,
25
- valKey:f.inSection+""+a.fields[e],thisField:c.fields[a.fields[e]],thisFieldCall:"input"+c.fieldKeys[a.fields[e]]},k=c;"checkbox"==g.thisField.type||"select"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,select"+k.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":"radio"==g.thisField.type||"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+
26
- k.fieldKeys[g.thisFieldId]);d=ba(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;k="["+g.thisFieldId+"]";k=k.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(k,"g"),d[g.valKey])}return b}function ba(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;var d;if(!1===a.inSection)d=jQuery(a.thisFieldCall);else if(d=Q(a),null===d||"undefined"===typeof d)d=jQuery(a.thisFieldCall);if(null===d||"undefined"===typeof d||1>d.length)return c;
27
- d.each(function(){var d;d=a.thisField;var e=!1;if("hidden"==this.type)""!==I(this)&&(e=!0);else if("select"==d.type){var h=this.className;h&&-1<h.indexOf("frm_other_trigger")&&(e=!0)}else("checkbox"==d.type||"radio"==d.type)&&-1<this.id.indexOf("-other_")&&0>this.id.indexOf("-otext")&&(e=!0);e?(e=0,"select"==d.type?"hidden"==this.type?(d=!1,2<this.name.split("[").length&&(d=!0),d||(e=I(this))):e=jQuery(this).closest(".frm_other_container").find(".frm_other_input").val():"checkbox"!=d.type&&"radio"!=
28
- d.type||"hidden"==this.type||(e=I(this)),d=e):d="checkbox"!==this.type&&"radio"!==this.type||!this.checked?jQuery(this).val():this.value;"undefined"===typeof d&&(d="");"date"==a.thisField.type&&(e=jQuery.datepicker.parseDate(b.date,d),null!==e&&(c[a.valKey]=Math.ceil(e/864E5)));""!==d&&0!==d&&(d=d.trim(),d=parseFloat(d.replace(/,/g,"").match(/-?[\d\.]+$/)));if("undefined"===typeof d||isNaN(d)||""===d)d=0;c[a.valKey]+=d});return c}function Q(a){if("undefined"===typeof a.triggerField)return null;var b=
29
- a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");if(b.length){var c=".frm_field_"+a.thisFieldId+"_container ";a=a.thisFieldCall.split(",");for(var d="",f=0,e=a.length;f<e;f++)""!==d&&(d+=","),d=d+c+a[f].replace("[id=","[id^=");return b.find(d)}return null}function I(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function S(a,b){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled","disabled");
30
- jQuery(a).find(".frm_ajax_loading").addClass("frm_loading_now");"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){b=b.replace(/^\s+|\s+$/g,"");0===b.indexOf("{")&&(b=jQuery.parseJSON(b));if(""===b||!b||"0"===b||"object"!=typeof b&&0===b.indexOf("<!DOCTYPE")){var d=document.getElementById("frm_loading");null!==d&&(b=jQuery(a).find("input[type=file]").val(),
 
31
  "undefined"!=typeof b&&""!==b&&setTimeout(function(){jQuery(d).fadeIn("slow")},2E3));b=jQuery(a).find(".g-recaptcha");b.length&&(1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&b.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');a.submit()}else if("object"!=typeof b){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var f=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+
32
  f+"_container").replaceWith(b);frmFrontForm.scrollMsg(f);if("function"==typeof frmThemeOverride_frmAfterSubmit){var f=jQuery('input[name="frm_page_order_'+f+'"]').val(),e=jQuery(b).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(e,f,b,a)}b=jQuery(a).find('input[name="id"]');b.length&&jQuery(document.getElementById("frm_edit_"+b.val())).find("a").addClass("frm_ajax_edited").click()}else{jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");
33
  f=!0;jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");var e="",h=!1,g=null,k;for(k in b)if(g=jQuery(a).find(jQuery(document.getElementById("frm_field_"+k+"_container"))),g.length){if(!g.is(":visible")){var l=g.closest(".frm_toggle_container");l.length&&l.prev(".frm_trigger").click()}g.is(":visible")&&(f=!1,""===e&&(frmFrontForm.scrollMsg(k,a,!0),e="#frm_field_"+k+"_container"),jQuery(a).find("#frm_field_"+k+"_container .g-recaptcha").length&&(h=
34
- !0,grecaptcha.reset()),g.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(k,b):g.append('<div class="frm_error">'+b[k]+"</div>"))}else if("redirect"==k){window.location=b[k];return}!0!==h&&jQuery(a).find(".g-recaptcha").closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');f&&a.submit()}},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");
35
- a.submit()}})}function ca(){T(jQuery(this),"clear")}function da(){T(jQuery(this),"replace")}function T(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 ea(){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,
36
- 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 fa(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){if("table"==b){var c=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,c.addColumn("number",frm_js.id));for(var f=a.fields.length,e="string",h=0,g=f;h<g;h++){var k=a.fields[h],e=U(k);c.addColumn(e,k.name)}h=!1;a.options.edit_link&&(h=!0,c.addColumn("string",
37
- a.options.edit_link));g=!1;a.options.delete_link&&(g=!0,c.addColumn("string",a.options.delete_link));k=0;if(null!==a.entries){var l=a.entries.length;c.addRows(l);for(var m=0,n=0;n<l;n++){var k=0,p=a.entries[n];d&&(c.setCell(m,k,p.id),k++);for(var q=0,r=f;q<r;q++){var t=a.fields[q],e=U(t),t=p.metas[t.id];"number"!=e||null!==t&&""!==t?"boolean"==e&&(t=null===t||"false"==t||!1===t?!1:!0):t=0;c.setCell(m,k,t);k++}h&&("undefined"!==typeof p.editLink?c.setCell(m,k,'<a href="'+p.editLink+'">'+a.options.edit_link+
38
- "</a>"):c.setCell(m,k,""),k++);g&&("undefined"!==typeof p.deleteLink?c.setCell(m,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" onclick="return confirm('+a.options.confirm+')">'+a.options.delete_link+"</a>"):c.setCell(m,k,""));m++}}else for(c.addRows(1),h=k=0,g=f;h<g;h++)0<k?c.setCell(0,k,""):c.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+a.options.form_id))).draw(c,a.graphOpts)}else ga(a)}})}function U(a){var b="string";
39
- if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function ga(a){var b=new google.visualization.DataTable,c=!1,d=!1,f=a.rows.length;if(0<f)if("table"==a.type){c=!0;b.addRows(a.rows[f-1][0]+1);for(var e=0;e<f;e++)b.setCell(a.rows[e])}else if("undefined"!=typeof a.rows[0].tooltip)for(var d=c=!0,h=0;h<f;h++){e=a.rows[h].tooltip;delete a.rows[h].tooltip;
40
- var g=Object.keys(a.rows[h]).map(function(b){return a.rows[h][b]});a.rows[h]=g;a.rows[h].push(e)}f=a.cols.length;if(c){if(0<f)for(c=0;c<f;c++)e=a.cols[c],b.addColumn(e.type,e.name);d&&(b.addColumn({type:"string",role:"tooltip"}),b.addRows(a.rows))}else{b=[[]];for(d=0;d<f;d++)b[0].push(a.cols[d].name);b=b.concat(a.rows);b=google.visualization.arrayToDataTable(b)}d=a.type.charAt(0).toUpperCase()+a.type.slice(1)+"Chart";(new google.visualization[d](document.getElementById("chart_"+a.graph_id))).draw(b,
41
- a.options)}function ha(){var a=jQuery(this),b=a.data("fid");a.wrap('<div class="frm_file_names frm_uploaded_files">');for(var c=a.get(0).files,d=0;d<c.length;d++)0===d?a.after(c[d].name+' <a href="#" class="frm_clear_file_link">'+frm_js.remove+"</a>"):a.after(c[d].name+"<br/>");a.hide();c=a.attr("name");c!="item_meta["+b+"][]"&&c.replace("item_meta[","").replace("[]","").split("][");a.closest(".frm_form_field").find(".frm_uploaded_files:last").after('<input name="'+c+'" data-fid="'+b+'"class="frm_transparent frm_multiple_file" multiple="multiple" type="file" />')}
42
- function ia(){ja(jQuery(this).parent(".frm_uploaded_files"))}function ka(){jQuery(this).parent(".frm_file_names").replaceWith("");return!1}function la(){var a="frm_section_"+jQuery(this).data("parent")+"-"+jQuery(this).data("key"),b=jQuery(document.getElementById(a)),c=b.find("input, select, textarea");b.fadeOut("slow",function(){b.remove();c.each(function(){if("file"!=this.type){var a=this.name.replace("item_meta[","").split("]")[2].replace("[","");E(a)}})});return!1}function ma(){var a=jQuery(this).data("parent"),
43
- b=0;0<jQuery(".frm_repeat_"+a).length&&(b=1+parseInt(jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-","")),"undefined"==typeof b&&(b=1));jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(b){var d=b.html,f=jQuery(d).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(f);var e=["other"],h,g="reset";x=f.attr("id");jQuery(d).find("input, select, textarea").each(function(){"file"!=
44
- this.type&&(h=this.name.replace("item_meta[","").split("]")[2].replace("[",""),-1==jQuery.inArray(h,e)&&(e.push(h),q("und",h,null,jQuery(this),g),E(h),g="persist"))});x="";for(var f=0,k=b.logic.check.length;f<k;f++)-1==jQuery.inArray(b.logic.check[f],e)&&1>jQuery(d).find(".frm_field_"+b.logic.check[f]+"_container").length&&(q("und",b.logic.check[f],null,null,g),g="persist");0<jQuery(d).find(".star").length&&jQuery(".star").rating();0<jQuery(d).find(".frm_chzn").length&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});
45
- "function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,b)}});return!1}function ja(a){a.fadeOut("slow",function(){a.remove()})}function na(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function Z(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function X(a){return jQuery.isArray(a)&&(1<a.length||""!==a[0])}function R(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function W(a,
46
- b){var c=[];if("undefined"==typeof document.querySelector)jQuery("#"+a+' input[type=checkbox]:checked, input[type=hidden][name^="'+b+'"]').each(function(){c.push(this.value)});else for(var d=document.querySelectorAll("#"+a+' input[type=checkbox], input[type=hidden][name^="'+b+'"]'),f=0;f<d.length;f++)("checkbox"==d[f].type&&d[f].checked||"hidden"==d[f].type)&&c.push(d[f].value);return c}var m=[],G=[],D=[],H=[],x="",J="",C=[];return{init:function(){jQuery(document).on("click",".frm_trigger",n);var a=
47
- jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():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",ca);jQuery(document).on("blur",".frm_toggle_default",da);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(ea);
48
- jQuery(document).on("change",".frm_multiple_file",ha);jQuery(document).on("click",".frm_clear_file_link",ka);jQuery(document).on("click",".frm_remove_link",ia);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});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"]',w);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',
49
- l);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',v);jQuery(document).on("change","input[type=file].frm_transparent",p);jQuery(document).on("click",".frm_remove_form_row",la);jQuery(document).on("click",".frm_add_form_row",ma);jQuery("a[data-frmtoggle]").click(na);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");
50
- a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())})},submitForm:function(a){a.preventDefault();jQuery(this).find(".wp-editor-wrap").length&&"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();J=jQuery(this).find('input[name="frm_action"]').val();C=[];frmFrontForm.getAjaxFormErrors(this);
51
- if(0===C.length)S(this,J);else{jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");a=null;for(var b in C)a=jQuery(this).find(jQuery(document.getElementById("frm_field_"+b+"_container"))),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>"))}},getAjaxFormErrors:function(a){"function"==typeof frmThemeOverride_jsErrors&&
52
- (C=frmThemeOverride_jsErrors(J,a))},checkFormErrors:function(a,b){S(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a).offset());window.scrollTo(a.left,a.top)},scrollMsg:function(a,b,c){var d="";if(d="undefined"==typeof b?jQuery(document.getElementById("frm_form_"+a+"_container")).offset().top:jQuery(b).find(document.getElementById("frm_field_"+a+"_container")).offset().top){d-=frm_js.offset;a=jQuery("html").css("margin-top");b=jQuery("body").css("margin-top");if(a||b)d=d-parseInt(a)-
53
- parseInt(b);if(d&&window.innerHeight&&(a=document.documentElement.scrollTop||document.body.scrollTop,d>a+window.innerHeight||d<a))return"undefined"===typeof c?jQuery(window).scrollTop(d):jQuery("html,body").animate({scrollTop:d},500),!1}},hideCondFields:function(a){a=JSON.parse(a);for(var b=0,c=a.length;b<c;b++){var d=document.getElementById("frm_field_"+a[b]+"_container");null!==d?d.style.display="none":jQuery(".frm_field_"+a[b]+"_container").hide()}},checkDependent:function(a){a=JSON.parse(a);for(var b=
54
- "reset",c=0,d=a.length;c<d;c++)q("und",a[c],null,null,b),b="persist"},loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)for(var d=a[b[c]],f=b[c],e=0;e<d.length;e++)fa(d[e],f);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){var c=jQuery(a).parents("form:first").find('input[name="id"]');jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,
55
- date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var e in a)c.find('option[value="'+e+'"]').attr("disabled","disabled")}})},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",
56
- "visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});
57
- function frmEditEntry(l,n,p,v,w,q){var r=jQuery(document.getElementById("frm_edit_"+l)),u=r.html(),y=jQuery(document.getElementById(n+l)),A=y.html();y.html('<span class="frm-loading-img" id="'+n+l+'"></span><div class="frm_orig_content" style="display:none">'+A+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:p,entry_id:l,id:v,nonce:frm_js.nonce},success:function(A){y.children(".frm-loading-img").replaceWith(A);r.replaceWith('<span id="frm_edit_'+
58
- l+'"><a onclick="frmCancelEdit('+l+",'"+n+"','"+frmFrontForm.escapeHtml(u)+"',"+p+","+v+",'"+q+'\')" class="'+q+'">'+w+"</a></span>")}})}
59
- function frmCancelEdit(l,n,p,v,w,q){var r=jQuery(document.getElementById("frm_edit_"+l)),u=r.find("a"),y=u.html();u.hasClass("frm_ajax_edited")||(u=jQuery(document.getElementById(n+l)),u.children(".frm_forms").replaceWith(""),u.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));r.replaceWith('<a id="frm_edit_'+l+'" class="frm_edit_link '+q+'" href="javascript:frmEditEntry('+l+",'"+n+"',"+v+","+w+",'"+frmFrontForm.escapeHtml(y)+"','"+q+"')\">"+p+"</a>")}
60
- function frmUpdateField(l,n,p,v,w){jQuery(document.getElementById("frm_update_field_"+l+"_"+n)).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:l,field_id:n,value:p,nonce:frm_js.nonce},success:function(){""===v.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+w)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+w)).replaceWith(v)}})}
61
  function frmDeleteEntry(l,n){jQuery(document.getElementById("frm_delete_"+l)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+l+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:l,nonce:frm_js.nonce},success:function(p){"success"==p.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+l)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+l)).replaceWith(p)}})}
62
  function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
63
  function frm_resend_email(l,n){console.warn("DEPRECATED: function frm_resend_email in v2.0");$link=jQuery(document.getElementById("frm_resend_email"));$link.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:l,form_id:n,nonce:frm_js.nonce},success:function(l){$link.replaceWith(l)}})};
1
  function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",f=this.name;if("frm_prev_page"===f||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===f||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function n(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
2
+ jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){this.className=this.className.replace("frm_transparent","");this.parentNode.getElementsByTagName("a")[0].className.indexOf("frm_clear_file_link")}function u(){var a=this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,
3
  b=!1,f=0;f<d.length;f++)if("frm_other_trigger"===d[f].className&&d[f].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value="")):"radio"===a?jQuery(this).is(":checked")&&(jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):
4
+ "checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function v(a){var b=y(this);if(b&&"undefined"!==typeof b){var c="reset";if(a.frmTriggered){if(a.frmTriggered==b)return;c="persist"}r("und",b,null,jQuery(this),c);E(b,jQuery(this))}}function y(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name,c=c.replace("item_meta[",
5
+ "").replace("[]","").split("]"),c=c.filter(function(a){return""!==a}),d=c[0],f=!1;if(1===c.length)return d;jQuery('input[name="item_meta['+d+'][form]"]').length&&(d=c[2].replace("[",""),f=!0);"other"===d&&(d=f?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function r(a,b,c,d,f){var e;if("undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[b])e=void 0;else{e=__FRMRULES[b];for(var h=[],g=0,k=e.length;g<k;g++){var l=e[g];if("undefined"!==
6
+ typeof l)for(var F=0,n=l.Conditions.length;F<n;F++){var p=l.Conditions[F];p.HideField=l.Setting.FieldName;p.MatchType=l.MatchType;p.Show=l.Show;h.push(p)}}e=h}if("undefined"!==typeof e){if("undefined"===typeof c||null===c)c="go";"persist"!==f&&(m=[],C=[]);f=d;h=!1;""===w&&"undefined"!==typeof f&&null!==f&&(1<f.length&&(f=f.eq(0)),h=f.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid"),"undefined"!==typeof h?(w=h.attr("id"),h=!0):h=!1);f=h;h=e.length;for(g=0;g<h;g++)e[g].FieldName===b?
7
+ q(g,e[g],b,a,c,d):q(g,e[g],b,a,c),g===h-1&&(Y(c),f&&(w=""))}}function q(a,b,c,d,f,e){b.inputName="item_meta["+b.FieldName+"]";b.hiddenName="item_meta["+b.HideField+"]";b.containerID="frm_field_"+b.FieldName+"_container";b.hideContainerID="frm_field_"+b.HideField+"_container";b.hideBy="#";var h=!1;if("undefined"!==typeof e&&null!==e){1<e.length&&(e=e.eq(0));if("undefined"===typeof e.attr("name"))return;b.inputName=e.attr("name").replace("[other]","").replace("[]","");var g=e.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");
8
+ g.length&&(g=g.find(".frm_field_"+b.FieldName+"_container"),b.containerID=g.attr("id"),b.hideContainerID=b.containerID.replace(b.FieldName,b.HideField),b.hiddenName=b.inputName.replace("["+b.FieldName+"]","["+b.HideField+"]"))}else{x(b);h=!0;e=jQuery('input[name^="'+b.inputName+'"], textarea[name^="'+b.inputName+'"], select[name^="'+b.inputName+'"]');if(1>e.length&&(g="."+b.containerID,""!==w&&(g="#"+w+" "+g),g=jQuery(g),g.length)){e=g.find("input, textarea, select");if(e.length)if(""===w){var k=
9
+ "";e.each(function(){var c=jQuery(this).closest(".frm_form_field").attr("id");c!=k&&q(a,b,b.FieldName,d,f,jQuery(this));k=c})}else q(a,b,c,d,f,e);else m[b.hideContainerID][a]=!1,K(a,b,f);return}1<e.length&&(e=e.eq(0))}x(b);null===document.getElementById(b.hideContainerID)&&(b.hideBy=".");if(b.FieldName!==c||"undefined"===typeof d||"und"===d)if(("radio"===b.Type||"data-radio"===b.Type)&&"radio"===e.attr("type"))d=jQuery('input[name="'+b.inputName+'"]:checked').val(),"undefined"===typeof d&&(d="");
10
+ else if("select"===b.Type||"time"===b.Type||"data-select"===b.Type||"checkbox"!==b.Type&&"data-checkbox"!==b.Type)d=e.val();if("undefined"===typeof d){if(0===e.length)return;d=e.val()}if("undefined"===typeof d){if(!0===h&&(c=jQuery("."+b.containerID+" input, ."+b.containerID+" select, ."+b.containerID+" textarea"),c.length)){c.each(function(){q(a,b,b.FieldName,d,f,jQuery(this))});return}d=""}c=[];if("checkbox"===b.Type||"data-checkbox"===b.Type)c=Z(b.containerID,b.inputName),d=c.length?c:"";m[b.hideContainerID][a]=
11
+ null===d||""===d||1>d.length?!1:{funcName:"getDataOpts",f:b,sel:d};if("checkbox"===b.Type||"data-checkbox"===b.Type&&"undefined"===typeof b.LinkedField)if(c=m[b.hideContainerID][a]=!1,""!==d)for("!="===b.Condition&&(m[b.hideContainerID][a]=!0),e=0;e<d.length;e++)c=z(b.Condition,b.Value,d[e]),"!="===b.Condition?!0===m[b.hideContainerID][a]&&!1===c&&(m[b.hideContainerID][a]=!1):!1===m[b.hideContainerID][a]&&c&&(m[b.hideContainerID][a]=!0);else c=z(b.Condition,b.Value,""),!1===m[b.hideContainerID][a]&&
12
+ c&&(m[b.hideContainerID][a]=!0);else if("undefined"!==typeof b.LinkedField&&0===b.Type.indexOf("data-")){if("undefined"===typeof b.DataType||"data"===b.DataType)""===d?A(b.hideContainerID,b.hideBy,b.HideField,"hide"):"data-radio"===b.Type?m[b.hideContainerID][a]="undefined"===typeof b.DataType?z(b.Condition,b.Value,d):{funcName:"getData",f:b,sel:d}:"data-checkbox"===b.Type||"data-select"===b.Type&&aa(d)?(A(b.hideContainerID,b.hideBy,b.HideField,"show"),m[b.hideContainerID][a]=!0,L(b,d,1)):"data-select"===
13
+ b.Type&&(m[b.hideContainerID][a]={funcName:"getData",f:b,sel:d})}else"undefined"===typeof b.Value&&0===b.Type.indexOf("data")?(b.Value=""===d?"1":d,m[b.hideContainerID][a]=z(b.Condition,b.Value,d),b.Value=void 0):m[b.hideContainerID][a]=z(b.Condition,b.Value,d);K(a,b,f)}function x(a){"undefined"===typeof m[a.hideContainerID]&&(m[a.hideContainerID]=[])}function A(a,b,c,d){-1===jQuery.inArray(a,C)&&(C[c]=a,a="."===b?jQuery("."+a):jQuery(document.getElementById(a)),"hide"===d&&a.hide(),a.find(".frm_data_field_container").empty())}
14
+ function M(a,b){a.hide();if(-1===jQuery.inArray(a.attr("id"),C)){C[b.HideField]=a.attr("id");var c=N(a);if(c.length){c.prop("checked",!1).prop("selectedIndex",0);c.not(":checkbox, :radio, select").val("");var d=!1;c.each(function(){"SELECT"==this.tagName&&null!==document.getElementById(this.id+"_chosen")&&jQuery(this).trigger("chosen:updated");(!1===d||0>["checkbox","radio"].indexOf(this.type))&&B(jQuery(this));d=!0})}}}function N(a){return a.find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]:not([type=hidden])')}
15
+ function O(a,b){var c=N(a);a:{var d=c.length;if(c.is(":checkbox, :radio")){if(c.is(":checked"))break a}else if(c.val())break a;if(d)for(var f=0;f<d;f++){var e=jQuery(c[f]),h=e.data("frmval");if("undefined"!==typeof h)if(!e.is(":checkbox, :radio"))e.val(h),B(e);else if(e.val()==h||jQuery.isArray(h)&&-1!==jQuery.inArray(e.val(),h))e.prop("checked",!0),B(e)}}if(1<c.length)for(d=0;d<c.length;d++)P(b.HideField,jQuery(c[d]));else P(b.HideField,c);a.show()}function B(a,b){"undefined"===typeof b&&(b="dependent");
16
+ 1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function K(a,b,c){if("all"===b.MatchType||!1===m[b.hideContainerID][a])G.push({result:m[b.hideContainerID][a],show:b.Show,match:b.MatchType,FieldName:b.FieldName,HideField:b.HideField,hideContainerID:b.hideContainerID,hideBy:b.hideBy});else{var d="none";if("show"===b.Show){if(!0!==m[b.hideContainerID][a]){Q(m[b.hideContainerID][a],b.FieldName,c);return}d=""}a="."===b.hideBy?jQuery("."+b.hideContainerID):jQuery(document.getElementById(b.hideContainerID));
17
+ a.length&&("none"===d?M(a,b):O(a,b))}}function Y(a){jQuery.each(G,function(b,c){delete G[b];if("undefined"!==typeof c&&"undefined"!==typeof c.result){var d=jQuery(c.hideBy+c.hideContainerID),f=c.show;if(d.length){if("any"===c.match&&-1===jQuery.inArray(!0,m[c.hideContainerID])||"all"===c.match&&-1<jQuery.inArray(!1,m[c.hideContainerID]))f="show"===c.show?"hide":"show";"show"===f?(O(d,c),!1!==typeof c.result&&!0!==typeof c.result&&Q(c.result,c.FieldName,a)):M(d,c)}}})}function z(a,b,c){"undefined"===
18
+ typeof c&&(c="");jQuery.isArray(c)&&-1<jQuery.inArray(b,c)&&(c=b);-1!==String(b).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)&&(b=parseFloat(b),c=parseFloat(c));return"-1"!=String(b).indexOf("&quot;")&&z(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){return b?-1!=b.indexOf(a):0},"not LIKE":function(a,b){return b?-1==b.indexOf(a):1}}[a](b,c)}function Q(a,b,c){"getDataOpts"==
19
+ a.funcName?ba(a.f,a.sel,b,c):"getData"==a.funcName&&L(a.f,a.sel,0)}function L(a,b,c){var d=document.getElementById(a.hideContainerID),f=jQuery(d).find(".frm_data_field_container");if(0===f.length)return!0;c||f.html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:b,field_id:a.LinkedField,current_field:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(a){c?f.append(a):f.html(a);var b=f.children("input"),
20
+ g=b.val();d.style.display=""===a&&!c||""===g?"none":"";B(b);return!0}})}function ba(a,b,c,d){if(!("stop"==d&&-1<jQuery.inArray(a.HideField,H)&&a.parentField&&"hidden"==a.parentField.attr("type"))){var f=jQuery('input[name^="'+a.hiddenName+'"], select[name^="'+a.hiddenName+'"]:not(":disabled"), textarea[name^="'+a.hiddenName+'"]'),e=[];f.each(function(){"radio"===this.type||"checkbox"===this.type?!0===this.checked&&e.push(jQuery(this).val()):e.push(jQuery(this).val())});if("select"!=a.DataType||"stop"!=
21
+ d&&!jQuery("#"+a.hideContainerID+" .frm-loading-img").length||!(-1<jQuery.inArray(a.HideField,H))){0===e.length&&(e="");H.push(a.HideField);var h=document.getElementById(a.hideContainerID),g=jQuery(h).find(".frm_data_field_container");if(0===g.length&&f.length)return r(e,a.HideField,"stop",f),!1;if(""!==a.Value&&!z(a.Condition,a.Value,b))return h.style.display="none",g.html(""),r("",a.HideField,"stop",f),!1;g.html('<span class="frm-loading-img" style="visibility:visible;display:inline;"></span>');
22
+ var k=a.DataType;jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",hide_field:c,entry_id:b,selected_field_id:a.LinkedField,field_id:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(b){g.html(b);var c=g.find("select, input, textarea"),d=1;"hidden"==c.attr("type")&&(d=c.val());""===b||""===d?(h.style.display="none",e=""):"all"!=a.MatchType&&(h.style.display="");""!==b&&""!==e&&(jQuery.isArray(e)||(b=[],b.push(e),e=b),jQuery.each(e,function(a,
23
+ b){if("undefined"!==typeof b&&""!==b)if("checkbox"==k||"radio"==k)1<c.length?c.filter('[value="'+b+'"]').attr("checked","checked"):c.val()==b&&c.attr("checked","checked");else if("select"==k){var d=c.children('option[value="'+b+'"]');d.length?d.prop("selected",!0):e.splice(a,1)}else c.val(b)}));c.hasClass("frm_chzn")&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});B(c)}})}}}function E(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=
24
+ d.total,f=[],e=0,h=d.length;e<h;e++){var g;var k=b;g=c.calc[d[e]].field_id;var l=document.getElementById("frm_field_"+g+"_container");null!==l?g=0===l.offsetHeight?!0:!1:(k=k.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid"),k.length?(k=k[0].id.replace("frm_section_",""),g=document.getElementById("frm_field_"+g+"-"+k+"_container"),g=null!==g&&0===g.offsetHeight?!0:!1):g=!1);g||R(c,d[e],f,b)}}}function R(a,b,c,d){var f=a.calc[b],e=f.calc,h=jQuery(document.getElementById("field_"+b)),
25
+ g={triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>h.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=ca(a.fieldsWithCalc,b),h=S(g));e=da(f,e,a,c,g);a=f.calc_dec;e.indexOf(").toFixed(")&&(c=e.split(").toFixed("),T(c[1])&&(a=c[1],e=e.replace(").toFixed("+a,"")));e=parseFloat(eval(e));T(a)&&(e=e.toFixed(a));"undefined"===typeof e&&(e=0);h.val()!=e&&(h.val(e),B(h,b))}function da(a,b,c,d,f){for(var e=0,h=a.fields.length;e<h;e++){var g={triggerField:f.triggerField,
26
+ thisFieldId:a.fields[e],inSection:f.inSection,valKey:f.inSection+""+a.fields[e],thisField:c.fields[a.fields[e]],thisFieldCall:"input"+c.fieldKeys[a.fields[e]]},k=c;"checkbox"==g.thisField.type||"select"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,select"+k.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":"radio"==g.thisField.type||"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&
27
+ (g.thisFieldCall=g.thisFieldCall+",textarea"+k.fieldKeys[g.thisFieldId]);d=ea(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;k="["+g.thisFieldId+"]";k=k.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(k,"g"),d[g.valKey])}return b}function P(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fieldsWithCalc[a];"undefined"!==typeof d&&R(c,d,[],b)}}function ea(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;
28
+ var d;if(!1===a.inSection)d=jQuery(a.thisFieldCall);else if(d=S(a),null===d||"undefined"===typeof d)d=jQuery(a.thisFieldCall);if(null===d||"undefined"===typeof d||1>d.length)return c;d.each(function(){var d;d=a.thisField;var e=!1;if("hidden"==this.type)""!==I(this)&&(e=!0);else if("select"==d.type){var h=this.className;h&&-1<h.indexOf("frm_other_trigger")&&(e=!0)}else("checkbox"==d.type||"radio"==d.type)&&-1<this.id.indexOf("-other_")&&0>this.id.indexOf("-otext")&&(e=!0);e?(e=0,"select"==d.type?"hidden"==
29
+ this.type?(d=!1,2<this.name.split("[").length&&(d=!0),d||(e=I(this))):e=jQuery(this).closest(".frm_other_container").find(".frm_other_input").val():"checkbox"!=d.type&&"radio"!=d.type||"hidden"==this.type||(e=I(this)),d=e):d="checkbox"!==this.type&&"radio"!==this.type||!this.checked?jQuery(this).val():this.value;"undefined"===typeof d&&(d="");if("date"==a.thisField.type)d=jQuery.datepicker.parseDate(b.date,d),null!==d&&(c[a.valKey]=Math.ceil(d/864E5));else{""!==d&&0!==d&&(d=d.trim(),d=parseFloat(d.replace(/,/g,
30
+ "").match(/-?[\d\.]+$/)));if("undefined"===typeof d||isNaN(d)||""===d)d=0;c[a.valKey]+=d}});return c}function S(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):null}function I(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function U(a,b){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled",
31
+ "disabled");jQuery(a).find(".frm_ajax_loading").addClass("frm_loading_now");"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){b=b.replace(/^\s+|\s+$/g,"");0===b.indexOf("{")&&(b=jQuery.parseJSON(b));if(""===b||!b||"0"===b||"object"!=typeof b&&0===b.indexOf("<!DOCTYPE")){var d=document.getElementById("frm_loading");null!==d&&(b=jQuery(a).find("input[type=file]").val(),
32
  "undefined"!=typeof b&&""!==b&&setTimeout(function(){jQuery(d).fadeIn("slow")},2E3));b=jQuery(a).find(".g-recaptcha");b.length&&(1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&b.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');a.submit()}else if("object"!=typeof b){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var f=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+
33
  f+"_container").replaceWith(b);frmFrontForm.scrollMsg(f);if("function"==typeof frmThemeOverride_frmAfterSubmit){var f=jQuery('input[name="frm_page_order_'+f+'"]').val(),e=jQuery(b).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(e,f,b,a)}b=jQuery(a).find('input[name="id"]');b.length&&jQuery(document.getElementById("frm_edit_"+b.val())).find("a").addClass("frm_ajax_edited").click()}else{jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");
34
  f=!0;jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");var e="",h=!1,g=null,k;for(k in b)if(g=jQuery(a).find(jQuery(document.getElementById("frm_field_"+k+"_container"))),g.length){if(!g.is(":visible")){var l=g.closest(".frm_toggle_container");l.length&&l.prev(".frm_trigger").click()}g.is(":visible")&&(f=!1,""===e&&(frmFrontForm.scrollMsg(k,a,!0),e="#frm_field_"+k+"_container"),jQuery(a).find("#frm_field_"+k+"_container .g-recaptcha").length&&(h=
35
+ !0,grecaptcha.reset()),V(g,k,b))}else if("redirect"==k){window.location=b[k];return}!0!==h&&jQuery(a).find(".g-recaptcha").closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');f&&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"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,
36
+ c):a.append('<div class="frm_error">'+c[b]+"</div>"))}function fa(){W(jQuery(this),"clear")}function ga(){W(jQuery(this),"replace")}function W(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 ha(){var a=jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');
37
+ 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 ia(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){if("table"==b){var c=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,c.addColumn("number",frm_js.id));for(var f=a.fields.length,e="string",h=0,g=f;h<g;h++){var k=a.fields[h],e=X(k);c.addColumn(e,k.name)}h=
38
+ !1;a.options.edit_link&&(h=!0,c.addColumn("string",a.options.edit_link));g=!1;a.options.delete_link&&(g=!0,c.addColumn("string",a.options.delete_link));k=0;if(null!==a.entries){var l=a.entries.length;c.addRows(l);for(var m=0,n=0;n<l;n++){var k=0,p=a.entries[n];d&&(c.setCell(m,k,p.id),k++);for(var q=0,r=f;q<r;q++){var t=a.fields[q],e=X(t),t=p.metas[t.id];"number"!=e||null!==t&&""!==t?"boolean"==e&&(t=null===t||"false"==t||!1===t?!1:!0):t=0;c.setCell(m,k,t);k++}h&&("undefined"!==typeof p.editLink?c.setCell(m,
39
+ k,'<a href="'+p.editLink+'">'+a.options.edit_link+"</a>"):c.setCell(m,k,""),k++);g&&("undefined"!==typeof p.deleteLink?c.setCell(m,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" onclick="return confirm('+a.options.confirm+')">'+a.options.delete_link+"</a>"):c.setCell(m,k,""));m++}}else for(c.addRows(1),h=k=0,g=f;h<g;h++)0<k?c.setCell(0,k,""):c.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+a.options.form_id))).draw(c,a.graphOpts)}else ja(a)}})}
40
+ function X(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function ja(a){var b=new google.visualization.DataTable,c=!1,d=!1,f=a.rows.length;if(0<f)if("table"==a.type){c=!0;b.addRows(a.rows[f-1][0]+1);for(var e=0;e<f;e++)b.setCell(a.rows[e])}else if("undefined"!=typeof a.rows[0].tooltip)for(var d=c=!0,h=0;h<f;h++){e=
41
+ a.rows[h].tooltip;delete a.rows[h].tooltip;var g=Object.keys(a.rows[h]).map(function(b){return a.rows[h][b]});a.rows[h]=g;a.rows[h].push(e)}f=a.cols.length;if(c){if(0<f)for(c=0;c<f;c++)e=a.cols[c],b.addColumn(e.type,e.name);d&&(b.addColumn({type:"string",role:"tooltip"}),b.addRows(a.rows))}else{b=[[]];for(d=0;d<f;d++)b[0].push(a.cols[d].name);b=b.concat(a.rows);b=google.visualization.arrayToDataTable(b)}d=a.type.charAt(0).toUpperCase()+a.type.slice(1)+"Chart";(new google.visualization[d](document.getElementById("chart_"+
42
+ a.graph_id))).draw(b,a.options)}function ka(){var a=jQuery(this),b=a.data("fid");a.wrap('<div class="frm_file_names frm_uploaded_files">');for(var c=a.get(0).files,d=0;d<c.length;d++)0===d?a.after(c[d].name+' <a href="#" class="frm_clear_file_link">'+frm_js.remove+"</a>"):a.after(c[d].name+"<br/>");a.hide();c=a.attr("name");c!="item_meta["+b+"][]"&&c.replace("item_meta[","").replace("[]","").split("][");a.closest(".frm_form_field").find(".frm_uploaded_files:last").after('<input name="'+c+'" data-fid="'+
43
+ b+'"class="frm_transparent frm_multiple_file" multiple="multiple" type="file" />')}function la(){ma(jQuery(this).parent(".frm_uploaded_files"))}function na(){jQuery(this).parent(".frm_file_names").replaceWith("");return!1}function oa(){var a="frm_section_"+jQuery(this).data("parent")+"-"+jQuery(this).data("key"),b=jQuery(document.getElementById(a)),c=b.find("input, select, textarea");b.fadeOut("slow",function(){b.remove();c.each(function(){if("file"!=this.type){var a=this.name.replace("item_meta[",
44
+ "").split("]")[2].replace("[","");E(a)}})});return!1}function pa(){var a=jQuery(this).data("parent"),b=0;0<jQuery(".frm_repeat_"+a).length&&(b=1+parseInt(jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-","")),"undefined"==typeof b&&(b=1));jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(b){var d=b.html,f=jQuery(d).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(f);var e=
45
+ ["other"],h,g="reset";w=f.attr("id");jQuery(d).find("input, select, textarea").each(function(){"file"!=this.type&&(h=this.name.replace("item_meta[","").split("]")[2].replace("[",""),-1==jQuery.inArray(h,e)&&(e.push(h),r("und",h,null,jQuery(this),g),E(h,jQuery(this)),g="persist"))});w="";for(var f=0,k=b.logic.check.length;f<k;f++)-1==jQuery.inArray(b.logic.check[f],e)&&1>jQuery(d).find(".frm_field_"+b.logic.check[f]+"_container").length&&(r("und",b.logic.check[f],null,null,g),g="persist");0<jQuery(d).find(".star").length&&
46
+ jQuery(".star").rating();0<jQuery(d).find(".frm_chzn").length&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,b)}});return!1}function ma(a){a.fadeOut("slow",function(){a.remove()})}function qa(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function ca(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}
47
+ function aa(a){return jQuery.isArray(a)&&(1<a.length||""!==a[0])}function T(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function Z(a,b){var c=[];if("undefined"==typeof document.querySelector)jQuery("#"+a+' input[type=checkbox]:checked, input[type=hidden][name^="'+b+'"]').each(function(){c.push(this.value)});else for(var d=document.querySelectorAll("#"+a+' input[type=checkbox], input[type=hidden][name^="'+b+'"]'),f=0;f<d.length;f++)("checkbox"==d[f].type&&d[f].checked||"hidden"==d[f].type)&&
48
+ c.push(d[f].value);return c}var m=[],G=[],C=[],H=[],w="",J="",D=[];return{init:function(){jQuery(document).on("click",".frm_trigger",n);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",
49
+ ".frm_toggle_default",fa);jQuery(document).on("blur",".frm_toggle_default",ga);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(ha);jQuery(document).on("change",".frm_multiple_file",ka);jQuery(document).on("click",".frm_clear_file_link",na);jQuery(document).on("click",".frm_remove_link",la);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});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"]',
50
+ v);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',l);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',u);jQuery(document).on("change","input[type=file].frm_transparent",p);jQuery(document).on("click",".frm_remove_form_row",oa);jQuery(document).on("click",".frm_add_form_row",pa);jQuery("a[data-frmtoggle]").click(qa);
51
+ jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())})},submitForm:function(a){a.preventDefault();jQuery(this).find(".wp-editor-wrap").length&&
52
+ "undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();J=jQuery(this).find('input[name="frm_action"]').val();D=[];frmFrontForm.getAjaxFormErrors(this);if(0===Object.keys(D).length)U(this,J);else{jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");for(var b in D)a=jQuery(this).find(jQuery("#frm_field_"+b+"_container")),V(a,b,D)}},getAjaxFormErrors:function(a){"function"==typeof frmThemeOverride_jsErrors&&(D=frmThemeOverride_jsErrors(J,a))},checkFormErrors:function(a,
53
+ b){U(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a).offset());window.scrollTo(a.left,a.top)},scrollMsg:function(a,b,c){var d="";if(d="undefined"==typeof b?jQuery(document.getElementById("frm_form_"+a+"_container")).offset().top:jQuery(b).find(document.getElementById("frm_field_"+a+"_container")).offset().top){d-=frm_js.offset;a=jQuery("html").css("margin-top");b=jQuery("body").css("margin-top");if(a||b)d=d-parseInt(a)-parseInt(b);if(d&&window.innerHeight&&(a=document.documentElement.scrollTop||
54
+ document.body.scrollTop,d>a+window.innerHeight||d<a))return"undefined"===typeof c?jQuery(window).scrollTop(d):jQuery("html,body").animate({scrollTop:d},500),!1}},hideCondFields:function(a){a=JSON.parse(a);for(var b=0,c=a.length;b<c;b++){var d=document.getElementById("frm_field_"+a[b]+"_container");null!==d?d.style.display="none":jQuery(".frm_field_"+a[b]+"_container").hide()}},checkDependent:function(a){a=JSON.parse(a);for(var b="reset",c=0,d=a.length;c<d;c++)r("und",a[c],null,null,b),b="persist"},
55
+ loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)for(var d=a[b[c]],f=b[c],e=0;e<d.length;e++)ia(d[e],f);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){var c=jQuery(a).parents("form:first").find('input[name="id"]');jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),
56
+ nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var e in a)c.find('option[value="'+e+'"]').attr("disabled","disabled")}})},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();
57
+ jQuery(document).ready(function(l){frmFrontForm.init()});
58
+ function frmEditEntry(l,n,p,u,v,y){var r=jQuery(document.getElementById("frm_edit_"+l)),q=r.html(),x=jQuery(document.getElementById(n+l)),A=x.html();x.html('<span class="frm-loading-img" id="'+n+l+'"></span><div class="frm_orig_content" style="display:none">'+A+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:p,entry_id:l,id:u,nonce:frm_js.nonce},success:function(A){x.children(".frm-loading-img").replaceWith(A);r.replaceWith('<span id="frm_edit_'+
59
+ l+'"><a onclick="frmCancelEdit('+l+",'"+n+"','"+frmFrontForm.escapeHtml(q)+"',"+p+","+u+",'"+y+'\')" class="'+y+'">'+v+"</a></span>")}})}
60
+ function frmCancelEdit(l,n,p,u,v,y){var r=jQuery(document.getElementById("frm_edit_"+l)),q=r.find("a"),x=q.html();q.hasClass("frm_ajax_edited")||(q=jQuery(document.getElementById(n+l)),q.children(".frm_forms").replaceWith(""),q.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));r.replaceWith('<a id="frm_edit_'+l+'" class="frm_edit_link '+y+'" href="javascript:frmEditEntry('+l+",'"+n+"',"+u+","+v+",'"+frmFrontForm.escapeHtml(x)+"','"+y+"')\">"+p+"</a>")}
61
+ function frmUpdateField(l,n,p,u,v){jQuery(document.getElementById("frm_update_field_"+l+"_"+n)).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:l,field_id:n,value:p,nonce:frm_js.nonce},success:function(){""===u.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).replaceWith(u)}})}
62
  function frmDeleteEntry(l,n){jQuery(document.getElementById("frm_delete_"+l)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+l+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:l,nonce:frm_js.nonce},success:function(p){"success"==p.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+l)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+l)).replaceWith(p)}})}
63
  function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
64
  function frm_resend_email(l,n){console.warn("DEPRECATED: function frm_resend_email in v2.0");$link=jQuery(document.getElementById("frm_resend_email"));$link.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:l,form_id:n,nonce:frm_js.nonce},success:function(l){$link.replaceWith(l)}})};
js/formidable_admin.js CHANGED
@@ -111,6 +111,7 @@ function frmAdminBuildJS(){
111
  data:{action:'frm_form_action_fill', action_id:action_id, action_type:action_type, nonce:frmGlobal.nonce},
112
  success:function(html){
113
  cont.children('.widget-inside').html(html);
 
114
  }
115
  });
116
  }
@@ -217,7 +218,9 @@ function frmAdminBuildJS(){
217
  cancel:'.widget,.frm_field_opts_list,input,textarea,select,.edit_field_type_end_divider,.frm_ipe_field_option,.frm_sortable_field_opts',
218
  accepts:'field_type_list',
219
  revert:true,
220
- forcePlaceholderSize:true,
 
 
221
  receive:function(event,ui){
222
  if ( cancelSort ) {
223
  ui.item.addClass('frm_cancel_sort');
@@ -319,6 +322,11 @@ function frmAdminBuildJS(){
319
  }
320
  updateFieldOrder();
321
  },
 
 
 
 
 
322
  stop:function(event, ui){
323
  if ( cancelSort ) {
324
  jQuery(this).sortable('cancel');
@@ -1101,6 +1109,7 @@ function frmAdminBuildJS(){
1101
 
1102
  //check if icon should be active
1103
  checkActiveAction(type);
 
1104
  }
1105
  });
1106
  }
@@ -1506,6 +1515,15 @@ function frmAdminBuildJS(){
1506
  }
1507
  }
1508
 
 
 
 
 
 
 
 
 
 
1509
  /* Customization Panel */
1510
  function insertCode(){
1511
  insertFieldCode(jQuery(this), jQuery(this).data('code'));
@@ -1754,7 +1772,7 @@ function frmAdminBuildJS(){
1754
  function initiateMultiselect(){
1755
  jQuery('.frm_multiselect').multiselect({
1756
  templates: {ul:'<ul class="multiselect-container frm-dropdown-menu"></ul>'},
1757
- nonSelectedText:frm_admin_js.default
1758
  });
1759
  }
1760
 
@@ -1896,7 +1914,7 @@ function frmAdminBuildJS(){
1896
  setupSortable('ul.frm_sorting');
1897
 
1898
  // Show message if section has no fields inside
1899
- var frm_sorting = document.getElementsByClassName('start_divider frm_sorting');
1900
  for ( i = 0; i < frm_sorting.length ; i++) {
1901
  if ( frm_sorting[i].children.length < 2 ) {
1902
  jQuery(frm_sorting[i]).parent().children('.frm_no_section_fields').addClass('frm_block');
@@ -2005,7 +2023,8 @@ function frmAdminBuildJS(){
2005
  $formActions.on('click', '.frm_add_posttax_row', addPosttaxRow);
2006
  $formActions.on('click', '.frm_toggle_cf_opts', toggleCfOpts);
2007
  jQuery('.frm_actions_list').on('click', '.frm_active_action', addFormAction);
2008
-
 
2009
  //set actions icons to inactive
2010
  jQuery('ul.frm_actions_list li').each(function(){
2011
  checkActiveAction(jQuery(this).children('a').data('actiontype'));
@@ -2179,6 +2198,8 @@ function frmAdminBuildJS(){
2179
  $addRemove.on('click', '.frm_add_where_row', addWhereRow);
2180
  $addRemove.on('change', '.frm_insert_where_options', insertWhereOptions);
2181
  $addRemove.on('change', '.frm_where_is_options', hideWhereOptions);
 
 
2182
  },
2183
 
2184
  styleInit: function(){
111
  data:{action:'frm_form_action_fill', action_id:action_id, action_type:action_type, nonce:frmGlobal.nonce},
112
  success:function(html){
113
  cont.children('.widget-inside').html(html);
114
+ initiateMultiselect();
115
  }
116
  });
117
  }
218
  cancel:'.widget,.frm_field_opts_list,input,textarea,select,.edit_field_type_end_divider,.frm_ipe_field_option,.frm_sortable_field_opts',
219
  accepts:'field_type_list',
220
  revert:true,
221
+ forcePlaceholderSize:false,
222
+ tolerance:'pointer',
223
+ container: 'ul.frm_sorting',
224
  receive:function(event,ui){
225
  if ( cancelSort ) {
226
  ui.item.addClass('frm_cancel_sort');
322
  }
323
  updateFieldOrder();
324
  },
325
+ start: function( event, ui ) {
326
+ if ( ui.item[0].offsetHeight > 120 ) {
327
+ jQuery(sort).sortable( 'refreshPositions' );
328
+ }
329
+ },
330
  stop:function(event, ui){
331
  if ( cancelSort ) {
332
  jQuery(this).sortable('cancel');
1109
 
1110
  //check if icon should be active
1111
  checkActiveAction(type);
1112
+ initiateMultiselect();
1113
  }
1114
  });
1115
  }
1515
  }
1516
  }
1517
 
1518
+ function setDefaultPostStatus() {
1519
+ var urlQuery = window.location.search.substring(1);
1520
+ if ( urlQuery.indexOf('action=edit') === -1 ) {
1521
+ document.getElementById('post-visibility-display').innerHTML = frm_admin_js.private;
1522
+ document.getElementById('hidden-post-visibility').value = 'private';
1523
+ document.getElementById('visibility-radio-private').checked = true;
1524
+ }
1525
+ }
1526
+
1527
  /* Customization Panel */
1528
  function insertCode(){
1529
  insertFieldCode(jQuery(this), jQuery(this).data('code'));
1772
  function initiateMultiselect(){
1773
  jQuery('.frm_multiselect').multiselect({
1774
  templates: {ul:'<ul class="multiselect-container frm-dropdown-menu"></ul>'},
1775
+ nonSelectedText:frm_admin_js['default']
1776
  });
1777
  }
1778
 
1914
  setupSortable('ul.frm_sorting');
1915
 
1916
  // Show message if section has no fields inside
1917
+ var frm_sorting = jQuery('.start_divider .frm_sorting');
1918
  for ( i = 0; i < frm_sorting.length ; i++) {
1919
  if ( frm_sorting[i].children.length < 2 ) {
1920
  jQuery(frm_sorting[i]).parent().children('.frm_no_section_fields').addClass('frm_block');
2023
  $formActions.on('click', '.frm_add_posttax_row', addPosttaxRow);
2024
  $formActions.on('click', '.frm_toggle_cf_opts', toggleCfOpts);
2025
  jQuery('.frm_actions_list').on('click', '.frm_active_action', addFormAction);
2026
+ initiateMultiselect();
2027
+
2028
  //set actions icons to inactive
2029
  jQuery('ul.frm_actions_list li').each(function(){
2030
  checkActiveAction(jQuery(this).children('a').data('actiontype'));
2198
  $addRemove.on('click', '.frm_add_where_row', addWhereRow);
2199
  $addRemove.on('change', '.frm_insert_where_options', insertWhereOptions);
2200
  $addRemove.on('change', '.frm_where_is_options', hideWhereOptions);
2201
+
2202
+ setDefaultPostStatus();
2203
  },
2204
 
2205
  styleInit: function(){
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: sswells, srwells, jamie.wahlin
3
  Donate link: http://formidablepro.com/donate
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
5
  Requires at least: 3.6
6
- Tested up to: 4.2
7
- Stable tag: 2.0.10
8
 
9
  Beautiful forms in 60 seconds. The WordPress form builder that enables you to create forms with a simple drag-and-drop interface and in-place editing.
10
 
@@ -89,6 +89,42 @@ A. Try clearing your browser cache. As plugin modifications are made, frequent j
89
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Form FAQs")
90
 
91
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  = 2.0.10 =
93
  * Add frm_action_triggers hook for adding custom triggers into the actions
94
  * Add frm_{action name here}_action_options hook so any action can be altered
3
  Donate link: http://formidablepro.com/donate
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
5
  Requires at least: 3.6
6
+ Tested up to: 4.3
7
+ Stable tag: 2.0.11
8
 
9
  Beautiful forms in 60 seconds. The WordPress form builder that enables you to create forms with a simple drag-and-drop interface and in-place editing.
10
 
89
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Form FAQs")
90
 
91
  == Changelog ==
92
+ = 2.0.11 =
93
+ * Fix issue with clearing array keys when sanitizing an array when displaying entry values
94
+ * When the email "reply to" value uses the "from" setting, only use the email address without the name
95
+ * Switch the form action events to dropdown instead of checkboxes
96
+ * Shrink the reCaptcha on small screens
97
+ * Add font-weight 100-900 options to styler
98
+ * Add frm_email_message filter
99
+ * Fixes for javascript errors while form building in IE8
100
+ * Only load font.css for the admin bar when user can edit forms
101
+ * Add frm_include_form_tag filter for using div instead of form tag
102
+ * Add frm_show_submit_button filter for hiding and showing the submit button
103
+ * Fix date calculations using date formats that begin with the year
104
+ * Allow classes to be included on a hidden input
105
+ * Process the entry a little sooner (wp_loaded instead of wp)
106
+ * Add frm_capitalize layout class
107
+ * Make frm_customize class work for more field types
108
+ * **Pro Features:**
109
+ * Set new views to private by default
110
+ * Allow clickable=1 in the frm-show-entry shortcode
111
+ * Make sure to show the Add row button for repeating sections in IE9
112
+ * Correctly require a password before showing password protected views
113
+ * Add update_single_field function for easier updating of a single field
114
+ * Add frm_datepicker_formats hook for adding format additional options on the Formidable -> global settings page
115
+ * Add frm_csv_row hook for adding data to a row in the CSV
116
+ * Keep the Pending status selected after save in the post settings
117
+ * Add frm_is_dynamic_field_empty filter for overriding whether a dependent dynamic field is available for validation or if the value should be cleared
118
+ * Improve dragging and dropping large sections of fields
119
+ * Don't trigger form actions while importing
120
+ * Make sure $entry_ids is still intact for the frm_after_content hook
121
+ * Replace m/d/Y format option
122
+ * Fix updating a field with the frm-entry-update-field shortcode
123
+ * Work on calculating different combinations of fields inside and outside a repeating section
124
+ * Only return unique values when a list field is displayed based on checkboxes
125
+ * Fix searching entries with a trailing space
126
+ * Fix truncating in the dynamic content
127
+
128
  = 2.0.10 =
129
  * Add frm_action_triggers hook for adding custom triggers into the actions
130
  * Add frm_{action name here}_action_options hook so any action can be altered