diff --git a/gf-civicrm.php b/gf-civicrm.php index 446fdfb..afd67a9 100644 --- a/gf-civicrm.php +++ b/gf-civicrm.php @@ -643,12 +643,18 @@ function set_text_input_counter( $script, $form_id, $input_id, $max_length, $fie $max_length = 255; } - $script = - "if(!jQuery('#{$input_id}+.ginput_counter').length){jQuery('#{$input_id}').textareaCount(" . - " {'maxCharacterSize': {$max_length}," . - " 'originalStyle': 'ginput_counter gfield_description'," . - " 'displayFormat' : '#input " . esc_js( __( 'of', 'gravityforms' ) ) . ' #max ' . esc_js( __( 'max characters', 'gravityforms' ) ) . "'" . - " });" . "jQuery('#{$input_id}').next('.ginput_counter').attr('aria-live','polite');}"; + $displayFormat = esc_js( __( '#input of #max max characters', 'gravityforms' ) ); + + $script = <<